How about this suggestion?
Have a servlet filter controlling a read-only session, mapped to *.jsp,
plus override struts RequestProcessor.processActionPerform() to do:
- open read/write session
- open try block
- call ActionForward = super.processActionPerform()
- catch hibernate errors, rollback, set ActionForward -> useful errors
page, or even mapping.getInputForward()
- finally close session
- return ActionForward
This way you get the two session (r/w for action, r/o for jsp) model
suggested earlier, for which servlet filters alone was inadequate.
This path allows you to still act within the struts controller should
an error occur.
I think that's the way to go, or migrate to using Spring.
Stewart |