1 Reply Latest reply on Oct 8, 2009 11:50 AM by Tom Hampton

    Passing parameters to JSP included

    Nilson Parra Newbie

      Hi.

      I´m use Jboss Portal 2.7.0 GA, and my web application consists of:
      portlet class:

      public class TestPortlet extends GenericPortlet {
      
       protected void doView(RenderRequest request, RenderResponse response)
       throws PortletException, IOException {
      
       PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/uno.jsp?MiParametro=47");
       prd.include(request, response);
       }
      
      }
      


      jsp page "uno.jsp":
      <body>
      <jsp:include page="/jsp/dos.jsp" flush="true">
       <jsp:param name="otroParametro" value="40" />
      </jsp:include>
      </body>
      


      jsp page "dos.jsp":
      <body>
      <%out.println("MiParametro: "+request.getParameter("MiParametro"));
      out.println("otroParametro: "+request.getParameter("otroParametro"));
      %>
      </body>
      


      and xml file "portlet.xml":
      <portlet>
       <portlet-name>PruebaPortlet</portlet-name>
       <portlet-class>test.portlettest.TestPortlet</portlet-class>
       <supports>
       <mime-type>text/html</mime-type>
       <portlet-mode>view</portlet-mode>
       </supports>
       <portlet-info>
       <title>Prueba Portlet</title>
       </portlet-info>
       </portlet>
      


      when displaying the page containing the portlet, the result is:


      MiParametro: 47 otroParametro: null


      Does anyone know how can this problem be solved?
      would greatly appreciate any responses that guide me to solve it.

      Nilson

      PS. please excuse my English