[jboss-user] [JBoss Portal] - Re: JBoss Portlet Container 2.0.0 - Getting a Portal Page wo

terroene do-not-reply at jboss.com
Wed Jul 2 05:04:14 EDT 2008

"thomas.heute at jboss.com" wrote : Was it something missing from the doc ? (for others)

Ohh, hard answer:

First the docs (User_Guide) suggest everything is very easy to do:

just implement a portal and write a simple-portal-page like this (quote from the User_Guide):

  | <%@ page contentType="text/html;charset=UTF-8" language="java" %>
  | <%@ taglib uri="/WEB-INF/portal.tld" prefix="portal" %>
  | <?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE html
  | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  | <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  | <head>
  | <title>Simple portal page</title>
  | </head>
  | <body>
  | <portal:page>
  | <portal:portlet name="JSPPortlet"
  | applicationName="samples-jsp-portlet">
  | <portal:portletmarkup/>
  | </portal:portlet>
  | </portal:page>
  | </body>
  | </html>

This doesn't work so easy, there are additional steps to mention:

1) To build a war that works with the container you have to include the following libraries at build time (currently I'm using Netbeans):

ccpp-1.0.jar                common-common-1.2.0.jar
common-portal-1.2.0.jar     portlet-api-2.0.jar
portlet-portlet-2.0.0.jar   web-web-1.2.0.jar

-> found in JBOSS_HOME/server/default/deploy/simple-portal/lib

2) In the war-file you have to include the following libraries into the directory WEB-INF/lib:

common-mc-1.2.0.jar                 jboss-common-core-2.2.3.GA.jar
jboss-dependency-2.0.0.Beta13.jar   jboss-kernel-2.0.0.Beta13.jar
jboss-mdr-2.0.0.Beta14.jar          jboss-reflect-2.0.0.Beta12.jar
jbossxb-2.0.0.CR8.jar               portlet-controller-2.0.0.jar
-> found in JBOSS_HOME/server/default/deploy/simple-portal/simple-portal.war/WEB-INF/lib

3) To get the extended Taglib I simply copied
to my WEB-INF directory

4) I really don't know, what the controller-filter is doing but I recognized two filters in the web.xml of simple-portal.war:

I think the listener is only needed for beans,
but my Web-Application won't work without the filters,
so I included them into my web.xml:

  | <filter>
  |       <filter-name>ErrorHandlingFilter</filter-name>
  |       <filter-class>org.jboss.portal.portlet.portal.ErrorHandlingFilter</filter-class>
  |    </filter>
  |    <filter>
  |       <filter-name>ControllerFilter</filter-name>
  |       <filter-class>org.jboss.portal.portlet.portal.jsp.ControllerFilter</filter-class>
  |    </filter>
  |    <filter-mapping>
  |       <filter-name>ErrorHandlingFilter</filter-name>
  |       <url-pattern>*.jsp</url-pattern>
  |    </filter-mapping>
  |    <filter-mapping>
  |       <filter-name>ControllerFilter</filter-name>
  |       <url-pattern>*.jsp</url-pattern>
  |    </filter-mapping>
  | <listener>
  |   <listener-class>
  | org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
  |    </listener>
  |    <servlet>
  |       <servlet-name>ContainerServlet</servlet-name>
  |      <servlet-class>
  | org.jboss.portal.web.impl.tomcat.TC6ContainerServlet
  | </servlet-class>
  |       <load-on-startup>0</load-on-startup>
  |    </servlet>

I also included the following files into the WEB-INF-directory:

context.xml       jboss-beans.xml
jboss-web.xml     portal.tld

-> found in JBOSS_HOME/server/default/deploy/simple-portal/simple-portal.war/WEB-INF

Perhaps I'm an idiot and everything is much easier, but now my portal-page works.

I still have some strange problems:

1) Still I can't get the "<portal:portlet>"-tag to work, i.e. using this tag doesn't cause an exception but the portlet won't appear. The taglib is included!
So I'm using the extended taglib.

2) The resizing problem (view the other post)

Please excuse my crappy english,
best regards,

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4161977#4161977

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4161977

More information about the jboss-user mailing list