Here is another "less hardcoded" solution that reads name of the JSP file as an 
portlet parameter:

Portlet's doView() method:

                String startJSPPage = 
getPortletConfig().getInitParameter("startPage");
  |             PortletRequestDispatcher rd = 
getPortletContext().getRequestDispatcher(
  |                             startJSPPage);
  |             rd.include(request, response);
  | 


Portlet.xml:

   <portlet>
  |       <portlet-name>TestPortlet</portlet-name>
  |       <portlet-class>si.avris.centrala.jbportal.portlet.Test</portlet-class>
  |       <init-param> 
  |         <name>startPage</name> 
  |         <description>Start JSP page</description> 
  |         <value>/WEB-INF/jsp/StartPage.jsp</value> 
  |       </init-param>
  |       <supported-locale>en</supported-locale>
  |       <!-- <resource-bundle>Resource</resource-bundle> -->
  |       <supports>
  |          <mime-type>text/html</mime-type>
  |          <portlet-mode>VIEW</portlet-mode>
  |       </supports>
  |       <portlet-info>
  |          <title>My JSP Test Portlet</title>
  |       </portlet-info>
  |    </portlet>
  | 

This way path to start JSP file can be changed without modifying code.

Andrej

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

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


-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP,
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to