-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Using filter
PostPosted: Mon Sep 01, 2003 4:10 am 
Newbie

Joined: Wed Aug 27, 2003 4:39 am
Posts: 10
I want to use a servlet for application start up say,StartupListener which extends HttpServlet to initialise the session factory and an ActionFilter to get the session from thread local and pass it to the action class. I specify the following in my web.xml file. I find that if I specify the action filter in web.xml as shown the init method in StartuoListener is not read. Is this the way to configure web.xml when both filter and servlet is used.
<filter>
<filter-name>actionFilter</filter-name>
<filter-class>com.softex.eg.web.filter.ActionFilter</filter-class>
</filter>

<!-- Start Servlet Configuration -->
<servlet>
<servlet-name>StartupListener</servlet-name>
<servlet-class>com.softex.eg.web.listener.StartupListener</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 01, 2003 6:49 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Your configuration is OK. What exactly is your problem?

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 02, 2003 11:09 pm 
Newbie

Joined: Tue Aug 26, 2003 9:59 am
Posts: 19
Location: Atlanta, GA
You need to specify the filter mapping like the following:
Code:
   <filter>
      <filter-name>PersistenceFilter</filter-name>
      <filter-class>com.jadecove.util.Persistence</filter-class>
   </filter>
   
   <filter-mapping>
      <filter-name>PersistenceFilter</filter-name>
      <url-pattern>*.do</url-pattern>
   </filter-mapping>
 
   <filter-mapping>
      <filter-name>PersistenceFilter</filter-name>
      <url-pattern>*.jsp</url-pattern>
   </filter-mapping>

_________________
Bill Siggelkow


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.