Forward back to same page in Struts
843836Apr 7 2005 — edited Aug 5 2005Hey guys,
i've butsted my brain on this one for a while and can't find the solution. any help is much appreciated!
i have a login form that appears on every single page of the website i'm developing. A requirement of the application is that when the user chooses to log in using the login form, they will simply come back to the same page they were on before they logged in.
So in the struts action, i'd like to do the login logic, and the foward back to the "input" page. in the struts-config file there is a attribute in the action declaration input="someurl" but as the login form appears on all pages, the input page is could be anything so it can't be set in the struts-config.
so my question is, how can i find out what the input page was?
there are a couple of other cases where i need to forward back to a dynamic input page as well. it's a pretty simple idea and i'm sure i'm not the first person who needs to do it. how have other people solved this problem using struts?
I've i can't find a way to do it i'm going to have to implement filter that keeps track of the user's current page and stores it in session where it can be retrieved by an action for forwarding. but that's as a last resort because i'm hoping struts has a way!!