This is all off the top of my head, not sure if you had already thought of this. But, I'd imagine that you could use an Action class that chose the appropriate forward base on an object in the HttpRequest/Session. This object could be built by the action that brought you the page you're already looking at. In this object, contain the forward (to the previous page - all forwards should be mapped in your struts-config.xml) and any parameters you need for the previous page.
Just one solution. You shouldn't have to put any Java code into the page to do this. -------------------------- Terry Drozdowski Staff, Technology Services SIM Technology - Phoenix Charles Schwab & Co. (602)355-8843 � Warning: All e-mail sent to this address will be received by the Charles Schwab Corporate e-mail system and is subject to archival and review by someone other than the recipient. -----Original Message----- From: Greg Callaghan [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 01, 2001 3:22 PM To: [EMAIL PROTECTED] Subject: Back to Previous Page - Recommended approach for struts??? Hi, What's the recommended approach in struts for implementing a "go back to previous page" button, in the situation when you may have arrived at that page from more than one path??? Eg. View may be a "Show Items" page, which you can get to say -: (a) from the main page - in which all items are displayed (b) from a search page - in which only selected items are displayed (ie the expected collection of items the VIEW requires has less entries in it here) (c) from another page which relates specifically to an item, then you link from here to the show items page to see detail of that item (ie in this case only 1 item will be in the collection) The requirement is to have a single BACK BUTTON on the screen that will go back to the page one come from. Note that in the case of (c) it the page requires some input (eg parameter, or populated form bean in scope). Options that come to mind -: * use browser go back (but doesn't seem elegant)?? * hard code logic into pages (but goes against the grain of struts??) * a struts approach??....... Hope that makes sense. Thanks in advance. Regards Greg _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

