• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

doFilter - what to do in this case?

 
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Ranch Hand
Posts: 241
 
Vinnie Jenks
Ranch Hand
Posts: 207
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic