I have a Screen (Stat.jsp) that can be accessed from two different screens. Once the user is finished with Stat.jsp they should return to the screen they originally came from. In other words, I have an ActionMapping that on "success" should return to the screen it was called from.
Does Struts give you an easy way to accomplish this? How can I determine what screen I came from?
I have a same requirement. This is how I was thinking I can accomplish this. Let us say we have three jsp's. 1.jsp. 2.jsp and 3.jsp
3.jsp can be accessed from 1.jsp and 2.jsp. In both 1.jsp and 2.jsp I will have a hidden field called URL which is set to parentURL hidden field in 3.jsp. From Action class of 3.jsp I would say (request.getRequestDispatcher()).forward(form.getParentURL) which takes back to parent jsp.
Does that mean that Struts does not provide any direct support for this type of situation? I imagine that even a reasonably complex application will have this type of situation occur several times.
Doesn't Struts natively support this type of thing? Am I missing something?
Joined: Jul 07, 2004
It should be possible. Am not comfortable with this solution because of the scriplet but it should work i guess.
Joined: Sep 08, 2004
I recognize there are many different ways this problem can be solved. I've done it myself several times while using my own homegrown web based application framework. What I'm trying to find out is whether Struts provides any direct support for this very common type of situation.