Creating custom layouts in JBoss Portal

The layout of a portlet is handled by a set of JSP in the portal-core web-app which is part of the jboss-portal.sar. In the web-inf direcotry have a look at portal-layouts.xml to see how various layouts are configured. The following is a snippet (self explainatory):

  <uri state="maximized">/layouts/mylayout/maximized.jsp</uri>
    <region name="regionBody"/>

You can make changes to these JSPs and the portal-layouts.xml. Alternatively (recommended), create you own theme in a separate web app (war file) and change the following config in jboss-portal.sar/META-INF/jboss-service.xml. You need to change the fillowing lines:

  • Change layout context path: <attribute name="TargetContextPath">/mylayoutapp</attribute>
  • Change path to header jsp: <attribute name="HeaderPath">/WEB-INF/jsp/myheader.jsp</attribute>
  • Change path to tabs (navigation) jsp: <attribute name="TabsPath">/WEB-INF/jsp/mynavigation.jsp</attribute>

The new war file will need to have access to the to portal lib tag-libs. These can be found at jboss-portal.sar/portal-core.war/WEB-INF.  Your layout JSP specified as “url” in the portal-layouts.xml will need to include the following directives:

  • In the html header: <p:theme themeName=”mytheme”/>, <p:headerContent/>.  See for a guide on creating custom themes.
  • In the body: <p:region regionName=’regionBody’ regionID=’regionBody’ />. This will need to be added for all the regions defined in the portal-layout.xml for this particular layout.

Note: Theme and layouts can be specified in the portal page deployment descriptor (see property and


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: