> -----Original Message----- > From: Paul Hussein [mailto:[EMAIL PROTECTED] > Sent: Wednesday, November 19, 2003 12:13 PM > To: Jetspeed User Mailing List > Subject: Passing parameters between portlets > > > Hi, > > I have a question about passing parameters between portlets. > > I want to pass some JSP generated HTML form parameters from > the portal it is in to another portal for processing. I cant > see how to do this. When I forward to the next portal and > check the portalparams there is nothing. > > I have a form in a portlet that is created using JSP and the > JSPPortlet definition in the xreg. > > XREG > > ?xml version="1.0" encoding="UTF-8"?> > <registry> > <portlet-entry name="GMO Form" hidden="false" type="ref" > parent="JSP" application="false"> > <meta-info> > <title>GMO Form</title> > <description>GMO Form</description> > </meta-info> > > <classname>org.apache.jetspeed.portal.portlets.JspPortlet</classname> > <parameter name="template" value="form1.jsp" hidden="true" > cachedOnName="true" cachedOnValue="true"/> > <media-type ref="html"/> > <url cachedOnURL="true"/> > <category group="gmo.dynamic">GMO REGEX Dynamic > Content Porlets</category> > </portlet-entry> > </registry> > > > FORWARD XML > <?xml version="1.0" encoding="UTF-8"?> > <forwards-configuration> > <forward name='CreateDossierForward'> > <pane id='P-f8ef4c6266-10007'/> > </forward> > </forwards-configuration> > > > > JSP > > <[EMAIL PROTECTED] contentType="text/html"%> > <%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' > prefix='jetspeed'%> > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN" > "http://www.w3.org/TR/REC-html40/frame.dtd"> > <html> > <head> > <title>Document Handling</title> > </head> > <body> > <form action="<jetspeed:forward > name='CreateDossierForward'/>" method="post"> > <p> > <br> > <table> > <tr> > <td> Dossier Type </td> > <td> <input type="text" name="dossiertype" > value="bsnif_gmp"> </td> > </tr> > <table> > <br> > <input type="submit" name="eventSubmit_doUpdate" value="Update"> > <input type="reset" value="Reset"> > </p> > </form> > </body> > </html> >
The problem is that forwards are done using redirect. This creates a new request which will not contain the request parameters sent with the form. In Velocity, you can add request parameters to the forward URL by using addQueryData(), but I don't know if this is possible in JSP, and anyway would not be much help to you because the parameters are part of the form. So you probably need to do the forward in Java, using the ForwardService. There you can add the request parameters from the form, or put them in the session and collect them in the second portlet. See http://jakarta.apache.org/jetspeed/site/forwards.html HTH -- Holger Dewes --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
