This is one of those "too close to the tree to see the forest" kind of questions. I want to provide a subclass of HttpServlet (which I'm calling HttpAuthServlet) which checks the state of things
HttpSession session = req.getSession( true ) ;
Object passed = session.getValue( "login.passed" ) ;
if ( passed == null ) { // send user to login page }
I have that working. What doesn't work is that I want this functionality to be automagical. When I subclass this class, say
public class Welcome extends HttpAuthServlet {
I want this testing to happen without having to explicitly call super.doGet(); a programmer who forgets or intentionally omits the super would circumvent the entire point of adding access control to the servlets.
How do I do this? Put it into the service() part of HttpAuthServlet? If so, do I have to do the dispatching to doGet and doPost myself?
What am I overlooking? Help gratefully appreciated.
------------------
Since EBCDIC
Make every post count!