Re: HOWTO Invoke an action
Philip Luppens <[email protected]>
| Newsgroups | gmane.comp.java.open-symphony.webwork |
|---|---|
| Message-ID | <10371182.1147266372468.JavaMail.os-j2ee@opensymphony01.managed.contegix.com> |
Hold you horses, you're mixing a bit :-)
My interceptor does something like this:
- check if parameters named username and password exist (in request or cookies)
- if so, create a new map with those username and password parameters
- create a new ActionProxy mapped with "login" and the new map
- execute the ActionProxy, and if the return value is NOT success, do a redirect to Action.LOGIN
- the global result "login" does a redirect to the login page so users can log in again normally
Btw, I just noticed doing a redirect is actually very easy (I thought the intercept method returned void). Just do a return "login"; and put a variable with your redirect url string int the context. Then map a global result "login" which does a redirect or dispatch to your login page:
[code]
<global-results>
<result name="login"
type="redirect">/login!input.action?redirect=${redirect}</result>
</global-results>
[/code]
and use that passed variable redirect again to do another redirect when the login succeeds (<result name="success" type="redirect">${redirect}</result>).
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=28679&messageID=58619#58619
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]