Hi Pradeep

A servlet has direct access to the http session as normal. The "portlet session" is the same beast, but the variable names have a prefix indicating which portlet they belong to. If there are n portlets on a single page, there will be n portlet sessions.

The portlet JSR 168 API lets you choose where a portlet saves data - either in the global session (aka the servlet http session) or in the "private portlet session" for the portlet.
 - Anything a servlet stores into the session is available to all portlets.
- Anything a portlet stores in the global session will be available to a servlet. - Anything a portlet stores in the portlet session will also be available to the servlet, but the name will have been mangled to provide a separate namespace for each portlet instance, making access quite difficult. - To share session data, the servlet and the portlets must all be part of the same web application (i.e. packaged in the same .war file).

Also, this only applies to the action phase. To have data available during the render phase, you need to pass it across at action time. I'm not sure of the API call (setRenderParameters() ??).

Hope this does not confuse you further, and I hope I got it right :) The JSR 168 specification has a fairly lucid description of how this all works.

Regards

Ron


----- Original Message ----- From: "pradeep reddy" <[EMAIL PROTECTED]>
To: "Jetspeed Users List" <[email protected]>
Sent: Thursday, October 16, 2008 3:45 PM
Subject: RE: Login portlet action mapping.


That's a good solution Woonsan,

But it is compromising the entire notion of the image verification.
In the HTML view source it is showing the random number like below if i use parameters in the URL.

<img src="/j2-admin/Cap_Img.jsp?random=1e131">i tried to use the httpsession in login.jsp to store the attribute as well. it doesn't work, i mean the value will be null if you access the same in Cap_Img.jsp. So is there any way i can access the portletSession from even within servelt?

Thanks & Regards,
Pradeep.



Date: Wed, 15 Oct 2008 09:17:14 -0700> From: [EMAIL PROTECTED]> Subject: RE: Login portlet action mapping.> To: [email protected]> > Hi Pradeep,> > How about using parameters in the img tag?:> <img src="image.jsp?random_text=foo">> > Or, I don't think it's a good idea to use sessions of both portlet and servlet, but I think you can do it if it is necessary.> > In the login.jsp, you can store a value into session also, not just into portletSession.> And, you can retrieve the session value from the session.> > Regards,> > Woonsan> > > --- On Wed, 10/15/08, pradeep reddy <[EMAIL PROTECTED]> wrote:> > > From: pradeep reddy <[EMAIL PROTECTED]>> > Subject: RE: Login portlet action mapping.> > To: "Jetspeed Users List" <[email protected]>> > Date: Wednesday, October 15, 2008, 5:36 PM> > Hi woonsan,> > > > I am using the http session to store the value,but in the> > subsequent request if i try to retrieve the value,its value> > is null.> > from that i can infer that http session doesn't has any> > significance in portal context.> > > > > > LoginPortlet's viewpage is login.jsp and login.jsp has> > <img src="image.jsp">. so in loging jsp i> > have access to portlet session. when it comes to image.jsp> > there is no portlet session avalible. even if you store the> > values in the http session in that image.jsp, you are not> > going to get them in the next request.> > > > > > I am thinking is there any way that i could get the portlet> > session from componentmanager.> > > > Thanks & Regards,> > Pradeep.> > > > > > > > > > > Date: Wed, 15 Oct 2008 04:34:33 -0700> From:> > [EMAIL PROTECTED]> Subject: RE: Login portlet action> > mapping.> To: [email protected]> >> > Hi Pradeep,> > I think you were storing it to request,> > not to session.> If your jsp is not included by the> > portlet, why don't you use just session.setAttribute()> > and session.getAttribute()?> > Woonsan> > --- On> > Tue, 10/14/08, pradeep reddy <[EMAIL PROTECTED]>> > wrote:> > > From: pradeep reddy> > <[EMAIL PROTECTED]>> > Subject: RE: Login> > portlet action mapping.> > To: "Jetspeed Users> > List" <[email protected]>> >> > Date: Tuesday, October 14, 2008, 10:10 PM> > I am> > still fighting with the same issue.> > If i put some> > value into the http session(i am adding the> > random> > value generated for the image in login portletto the>> > > session), it is not going to be present in the next> > request.> > I tried to put the value into the portlet> > session in the> > following way,> > > >> > ((RequestContext)> >> > request.getAttribute(RequestContext.REQUEST_PORTALENV)).setAttribute("key",capstr);the>> > > result is nullpointerExcption. the instance of the> > request> > is Requestfacade. So how can i access> > portlet session from> > jsp??> > > >> > Regards,> > Pradeep.> > > > > > >> > > > From: [EMAIL PROTECTED]> To:> >> > [email protected]> Subject: RE: Login>> > > portlet action mapping.> Date: Tue, 14 Oct 2008> > 16:48:27> > +0530> > Thanks vivek,> > I do> > this way.>> > > Regards,> Pradeep.> >> > > > Date: Tue, 14> > Oct 2008 13:05:57> > +0200From: [EMAIL PROTECTED]:> >> > [EMAIL PROTECTED]: Re: Login> > portlet> > action mapping.> PradeepI would suggest> > you handle your> > image verification in your own> > servlet and then redirect it> > loginproxy servlet for> > jetspeed-2> > authentication.RegardsVivekpradeep reddy> > wrote: > >> > > Thanks Vivek, The real thing> > is, i am using the> > login.jsp which comes with the> > j2-application.apart from> > user name and password> > fields i added one more field like,> > one dynamic> > image, and a text box to enter the text on the> >> > image.Apart from the authentication provided by the portal> > i> > want to verify whether user entered correct text> > for the> > image.So i am just evaluating the options> > to write my> > verification code. instead of writing> > my own authentication> > provider, is there any simple> > solution for this issue?> > Regards,Pradeep.> >> > > Date: Tue, 14 Oct 2008> > 12:33:20 +0200>> > From: [EMAIL PROTECTED]> To:> >> > [email protected]> Subject: Re: Login>> > > portlet action mapping.> > Jetspeed 2 be> > default> > authenticate users via JAAS> > authentication.if you > wanna> > use your own> > implementation of JASS authentication.>> > Define> > your JAAS configuration location bean >> >> > "org.apache.jetspeed.security.AuthenticationProvider">>> > > > Regards> Vivek> > pradeep reddy> > wrote:>> > > This login portlet comes with the> > sample application> > j2-admin so it might be using> > JAAS for authentication.>> > > If that is the> > case, what are my options?> > >> > >> > Thanks & regards,> > Pradeep.> >>>> > > >> >> > > >> Date: Tue, 14 Oct> > 2008> > 12:15:01 +0200> From:> > [EMAIL PROTECTED]> To:> >> > [email protected]> Subject: Re: Login>> > > portlet action mapping.> > Are you trying to> > JAAS> > authentication ?> > pradeep reddy> > wrote:> > >> > > I come back with one more> > frivolous problem.> >> > Login portlet in the> > j2-admin is a pure jsp page. its form> > action is> > mapped to /login/proxy this in turn mapped to> >> > LoginProxyServlet in the web.xml.> > I changed> > this> > mapping to my servlet, but mine is pretty much> > same except> > an extra code for validating the image> > i added in the> > login.jsp.I placed my class in the> > shared directory.>> > > But my code is not> > getting executed?> > What is> > the best place> > modify ?> > > > Thanks &> >> > Regards,> > Pradeep.> > > > > >> > >> > >> >> > _________________________________________________________________>>> > > > Searching for the best deals on travel? Visit> > MSN> > Travel.> >> > http://in.msn.com/coxandkings> > >> > >> > >> >> > --------------------------------------------------------------------->>> > > To unsubscribe, e-mail:> >> > [EMAIL PROTECTED]> For>> > > additional commands, e-mail:> >> > [EMAIL PROTECTED]> > >>> > >> > >> >> > _________________________________________________________________>>> > > > Movies, sports & news! Get your daily> > entertainment> > fix, only on live.com> >>> > > http://www.live.com/?scope=video&form=MICOAL>> > >> > > > > Watch useful tips on recipes,> > fitness, yoga> > and fashion only on MSN videos. Try> > it!> > > >> >> > --------------------------------------------------------------------->>> > > To unsubscribe, e-mail:> >> > [EMAIL PROTECTED]> For>> > > additional commands, e-mail:> >> > [EMAIL PROTECTED]>> >> > _________________________________________________________________>>> > > Movies, sports & news! Get your daily entertainment> > fix,> > only on live.com>> >> > http://www.live.com/?scope=video&form=MICOAL> >> > _________________________________________________________________>> > > Movies, sports & news! Get your daily> > entertainment> > fix, only on live.com> >> > http://www.live.com/?scope=video&form=MICOAL> >> > > > >> > --------------------------------------------------------------------->> > To unsubscribe, e-mail:> > [EMAIL PROTECTED]> For> > additional commands, e-mail:> > [EMAIL PROTECTED]> > > _________________________________________________________________> > Want to explore the world? Visit MSN Travel for the best> > deals.> > http://in.msn.com/coxandkings> > > > > ---------------------------------------------------------------------> To unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: [EMAIL PROTECTED]>
_________________________________________________________________
Searching for the best deals on travel? Visit MSN Travel.
http://in.msn.com/coxandkings

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to