On Fri, 16 Aug 2002, Nikola Milutinovic wrote:

> Date: Fri, 16 Aug 2002 07:18:38 +0200
> From: Nikola Milutinovic <[EMAIL PROTECTED]>
> Reply-To: Tomcat Users List <[EMAIL PROTECTED]>
> To: Tomcat Users List <[EMAIL PROTECTED]>,
>      Josh <[EMAIL PROTECTED]>
> Subject: Re: Action before doGet / doPost??
>
> > Hi,
> >     I'm wondering if there's a way to get some code called before
> > doGet/doPost? I want to build a superclass for my JSP pages that checks for
> > some login stuff and redirects if it's not found, without having to put the
> > detect code in every page.
>
> That is a job for Servlet Container (Tomcat in this case). Servlets and
> JSPs can implement their own auth/login service, via sessions, but why
> re-invent the wheel?
>

This kind of thing sounds like a good use for one of the following
technologies:

* If you use container managed security (i.e. you put
  <security-constraint> elements in your web.xml file) you don't
  need to worry about this at all -- the container will take care
  of it for you.

* If you insist on doing your own authentication and access control,
  read up on Filters.  This is one of the things they are designed
  to support.

> Nix.
>

Craig



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to