I am working on a struts 2 application that takes credit card and ach payments. The application is ModelDriven, all the data entered on the screens are saved in a domain model that's in session.
The requirement is that once the payment service has been called successfully, the session should be invalidated and then the user be shown the confirmation screen with confirmation number and other details.
Problem is, in the last action class which loads the confirmation screen, I invalidate the session, and then route to the JSP. But the JSP for some reason calls the getModel method on the action which tries to load the domain object from session. Since the session is already invalidated, I am getting something like java.lang.IllegalStateException: getAttribute: Session already invalidated. On the browser, I see a Stream is already closed exception.
Looking at the stacktrace, there are a few <s:text tags on the JSP that inturn call the getModel. Why is the s:text calling getModel?
Can the gurus please point out if I am missing something, or doing something wrong? Thanks bunches!
This is action class that does session invalidation
The Base Action class has getModel method that loads the domain model from session into the action classes. I added the try catch block in the getModel method otherwise the JSP throws the IllegalStateException error
The JSP uses s:getText to display dynamic text either from Action class attributes or from the resource bundle