struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@albany.edu
Subject Re: Setting nocache
Date Thu, 12 Feb 2004 22:02:58 GMT
Hubert:
 Thanks for the info.  Based on my attempts, and speaking from a position
of ignorance I believe I am unable to use transaction tokens from my
initial login. I believe it's due to the way I set up entry into the web
app. ??

http://<entryURL>/ --forward----> index.jsp (submit to loginAction)
                         failure --^
                         success--> .interface.tile

That is, I have no initial action (breaks MVC2?).
Consequently, the index.jsp page where my login form resides is being
presented prior to any action where I could use saveToken().  ??

I assume this is also why the redirect="true" on the forward does not
prevent a re-POST?

In any case, I'm satisfied with what I have for the login portion. I chose
to use the fact that I store a user object in the session for
authenticated/authorized users. Re-POSTs to my login action for users
already logged in are just ignored now.

However, I can see how the transactions tokens will come in handy for the
remainder of my app. :)

Thanks to all who answered,
-Ryan

> Take a look at Struts transaction tokens.  That will help provide your Action
> with a flag to ignore successive transactions (in this case, logins), even
> when the user hits "ok" on the resend prompt.
> If you don't want the user to even see the resend prompt, you can redirect to
> the view after the transaction.  Even with a redirect, though, you might
> still want to add the transaction token checking.
>
>  - Hubert
>
> --- russo@albany.edu wrote:
> > Hi Jay:
> >  Thanks for the response. That didn't have the intended result but, it
> > appears to be working when I look at the headers.
> >  Maybe my goal's not clear?
> >  Outline of steps in my web app. and where I want to prevent repost as
> > follows:
> > 1) http://<host>:<port>/afadmin/
> >   presents login form
> >
> > 2) On successful login user info is stored in session and user is
> > forwarded to view:
> > http://<host>:<port>/afadmin/console.afr
> > At the moment this is just simple page with a header, menu, body and
> > footer.
> >
> >  If you hit the refresh at this view the browser still has the post data
> > from the login view and if I click "OK" it re-sends the login information.
> >
> > Is there a way to prevent the repost on the client end? Or, at least
> > indicate to the client that I'd like it to forget about the post
> > information from the previous view?
> > Or, am I approaching this incorrectly? Should I just ignore the re-post in
> > my loginAction ?
> >   I found this but, in my present state of mind (too darned tired) it
> > seems like overkill:
> >  http://www.livinglogic.de/Struts/
> >
> > Thanks,
> > -Ryan
> >
> > > In your struts-config.xml <controller> element, thus:
> > >
> > > <controller>
> > >
> > >     <set-property property="nocache" value="true"/>
> > >
> > > </controller>
> > >
> > > Jay
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Finance: Get your refund fast by filing online.
> http://taxes.yahoo.com/filing.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

|----------------------------------|
| Ryan Russo                       |
| russo@[noSPAM].albany.edu        |
| University at Albany--Computing  |
| <<remove [noSPAM] to e-mail>>    |
| Technical Services Web Team      |
|__________________________________|

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message