Thank you for the response.  After more investigation, and looking over the
WSRP specification, it appears that the remote portlet producer is
responsible for maintaining a users session with a portlet.  The particular
producer i am using is from ibm, and it seems that its interpretation (or
maybe this is just how it has to be) is to preserve a session, which is
good, but do it by generating a new session for every interaction and
copying the old session attributes into the new session.  This works in
almost all cases, as long as you don't care about the actual session id.
For me, the session id was all i cared about, so that was why i hit a wall.

My solution is to generate a unique id, store it as a hidden input on the
form, and also pass it as a parameter to the captcha servlet.  The captcha
servlet stores the generated captcha under this parameter id, and when i
submit my form, i use the hidden input to validate the correct captcha.  All
in all, not too bad of a solution, i just had to get away from using the
session id.

The session id does work fine when accessing the portlet directly, but i
want to have the same code running no matter the environment, so i am going
to go with my own id generation.


On 12/14/07, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
>
> Sorry I can't be of much help, as I have never tried a scenario like
> this. I assume this happens because the WSRP-container request and the
> servlet request acts as two different "clients". I did find an
> interesting thread [1] that's not really the same as your problem, but
> might contain some interesting information anyway.
>
> Nils-H
>
> [1] http://forums.oracle.com/forums/thread.jspa?threadID=341338
>
> On Dec 12, 2007 6:58 PM, Brian Relph <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I have a struts2 portlet with a registration page that contains a
> captcha.
> > The captcha i generate from a servlet that i declare in my web.xml and
> map
> > to /captcha.  The captcha's are identified by the session id of the
> request,
> > and then are validated in my action using the ServletRequestAware
> interface
> > and grabbing the session id from it.  I have deployed my portlet to WAS
> 6.1,
> > and have also run it using jetty/pluto, and everything seems to work
> fine in
> > these environments.  However, I would like to run my portlet remotely
> using
> > WSRP.  When doing this, it seems like there is a new session generated
> when
> > accessing the captcha servlet, different from the session used to access
> the
> > portlet.  This means that when i try to validate the captcha in my
> action,
> > no captcha exists for my portlet session id.  I realize that this is a
> very
> > convoluted setup, and probably not the fault of struts, but i was
> wondering
> > if there was a way to garuntee that only a single session is generated,
> or
> > if there was a way to find out about the captcha session from within
> action.
> >
> > I will be happy to provide any code / config files if you think that
> would
> > help.
> >
> > Thanks,
> >
> > Brian
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to