Hi This has all the making of a stupid question but here goes.
I have a page which can be accessed from many other pages. I want to implement a return button so that pressing it causes the page to forward back to where it came from.
I've thought of each start page having an action mapping with a parameter of the start path
e.g screen 1 submit maps to an action with a parameter of screen 1's path screen 2 submit maps to an action with a parameter of screen 2's path etc.
Setting a hidden field on the target screen and use this to get back to where you came from when you press the return button, e.g press return find the value of the hidden field and forward back to this!
Whew, is there a nicer way of doing this in struts?
Joined: Sep 06, 2005
When you implement the button as a submit button (e.g. <html:submit property="button"> you could add a value to it that contains the action path it's supposed to do. And you can fill that value by extracting it from the form property where you put in the action path on loading the page. So just use your form to store the different actions. Then in your action you can just read and execute required the action directly. Or am I just talking rubbish here?
Joined: Sep 16, 2005
that will give you a link that when you click will take you back
Joined: Sep 22, 2003
Hi Ergin, Rich,
Thanks for the answers.
Ergin, I could be talking rubbish but won't the submit button send a request path based on whats defined as the action on the html:form tag in the page containing the return button?
I suppose my question really is how do I get the path of screen 1 to be sent the page containing the return. Then I need to get hold of this when I press the submit button.
I could put it in the session but that doesn't seem right
Graham [ September 16, 2005: Message edited by: Graham VMead ]