Thread:
 struts / jsp session control 
 stewart.cambridge   23 Nov 2005, 07:07 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: stewart.cambridge (23 Nov 2005, 07:07) Replies: 0, Views: 33152
Subject: struts / jsp session control
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
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]