Re: request object being lost [Our Ref:CPT94F91]
Serge Huber <[email protected]>
| Newsgroups | gmane.comp.cms.jahia.template |
|---|---|
| Message-ID | <[email protected]> |
This is normal behavior. Basically in this case you need to use the
context ID to differentiate between the two instances. What I suggest is
that your portlet output something like :
<input type="hidden" name="contextID"
value="<%=request.getAttribute("org.portletapi.contextid")%>" />
and then you check for it again when you process the form by comparing
the request Attribute with the Parameter.
Regards,
Serge Huber.
[email protected] wrote:
>
> hi there,
>
> I have 2 instances of my portlet on the same Jahia page. Capturing
> data on 1 portlet makes it appear on the other one as well when the
> page refreshes. I dump the request map at the start of each servlet,
> and the request objects look identical - the request of the portlet
> appearing last overwrites the request of the one appearing first. It
> looks like the same request object is being passed to both portlets.
>
> My web.xml follows - its very simple
> <?xml version="1.0"?>
> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
> Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
> <web-app id="WebApp">
> <display-name>NCOP_Portlet_ParlPapers</display-name>
> <servlet>
> <servlet-name>controller</servlet-name>
> <display-name>Controller</display-name>
> <servlet-class>org.ncop.Controller</servlet-class>
> </servlet>
> <servlet-mapping>
> <servlet-name>controller</servlet-name>
> <url-pattern>/controller</url-pattern>
> </servlet-mapping>
> </web-app>
>
>
> The beginning of my servlet defines a form - and I attach the
> context-id to the end of the form. The form tag of the 1st instance
> follows:
> <form name="frmParlPapers285" method="post"
> action="/jahia/Jahia/cache/bypass/pid/11?appid=285_63&appparams=http%3A%2F%2Flocalhost%3A8080%2FNCOP_Portlet_ParlPapers_myjahiasite%2Fcontroller&resetAppSession=true#field_285">
>
>
> and the form tag of the 2nd instance follows:
> <form name="frmParlPapers286" method="post"
> action="/jahia/Jahia/cache/bypass/pid/11?appid=286_63&appparams=http%3A%2F%2Flocalhost%3A8080%2FNCOP_Portlet_ParlPapers_myjahiasite%2Fcontroller&resetAppSession=true#field_286">
>
>
> What could be causing the problem? Why is the 2nd instance's request
> object being passed to both servlets (portlets)?
>
> thanks,
> Manoj
>
> This e-mail is intended exclusively for the addressee.
> If you are not the addressee you must not read, copy, use or disclose
> the e-mail nor the content; please notify us immediately (by clicking
> "Reply") and delete this e-mail.
>