Alan,
Have you looked into writing an Interceptor? There are hooks at every 
stage of the request so that you can perform your own processing. You 
can look at the source code for Stripersist to get an idea of how to do it:
http://stripes-stuff.svn.sourceforge.net/viewvc/stripes-stuff/Stripersist/trunk/src/org/stripesstuff/stripersist/Stripersist.java?view=markup

Aaron

Alan Gutierrez wrote:
> In my first Stripes application, I created a ServletFilter that  
> closes my Hibernate connection.
>
> It added more verbiage to WEB-INF/web.xml . It seems like there's a  
> better way to do this. Isn't there some cleanup facility built into  
> Stripes? Am I missing something obvious, like why aren't you allowing  
> Hibernate to close itself?
>
> I'm sure this is a common case. Wondering if Servlet filters are the  
> best practice.
>
> public class SessionCloseFilter implements Filter
> {
>      public final static String SESSION_ATTRIBUTE =  
> "com.thinknola.signup.Session";
>
>      public void init(FilterConfig filterConfig) throws ServletException
>      {
>      }
>
>      public void doFilter(ServletRequest request,
>          ServletResponse response, FilterChain chain)
>          throws IOException, ServletException
>      {
>          try
>          {
>              chain.doFilter(request, response);
>          }
>          finally
>          {
>              Session session = (Session) request.getAttribute 
> (SESSION_ATTRIBUTE);
>              if (session != null)
>              {
>                  session.close();
>              }
>          }
>      }
>
>      public void destroy()
>      {
>      }
> }
>
> --
> Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
> 717 1428
> Think New Orleans | http://thinknola.com/
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to