This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

doFilter - what to do in this case?

 
Vinnie Jenks
Ranch Hand
Posts: 207
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use (or so I thought) the doFilter method...maybe.

I'm using Hibernate (but this is *not* a Hibernate question!) and I'm trying to test an example in the Hibernate in Action book where the author uses doFilter to end sessions in a layered application.

I declared it like so:



Obviously, this is not being overridden and I need to do more to use this method "automatically".

What am I doing wrong here?

Thanks!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64192
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you declare it in the web.xml?
 
Vinnie Jenks
Ranch Hand
Posts: 207
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Bear Bibeault:
Did you declare it in the web.xml?


Nope, I guess I'm not sure how this is done exactly...couldn't find a real simple, clear example.

I've found some info on making a "servlet filter" which just appears to be a servlet...but the servlet I made is just a plain ol' servlet...and I was under the impression that I could use the doFilter in a plain servlet like mine?

Thanks again!
 
Vinnie Jenks
Ranch Hand
Posts: 207
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the links, I'll read up a little more.

Here's what I did that *appears* to work (everything runs, just not sure yet what doFilter is doing, entirely).



As you can see, I implemented the Filter interface and overrode the doFilter method...I didn't do anything to web.xml to reflect this.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic