Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

doFilter - what to do in this case?  RSS feed

 
Vinnie Jenks
Ranch Hand
Posts: 207
  • 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
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • 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
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!