You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Randy Layman <ra...@aswethink.com> on 2001/08/10 21:32:59 UTC
Replacing j_sercurity_check
I'm trying to write my own authentication method that uses three
different things to logon (username, password, and a zone or realm). The
problem that I'm running into is the AccessInterceptor uses an inner class
to bind to the URL for j_security_check and I can't find any easy way to
override it. That inner class is where the credentials move from the
request to the session, and it only moves the j_username and j_password - I
want to move all form variables into session variables (something like
securityform.<var name>).
I tried registering my own servlet with the same name by calling
Context.addServlet (and the servlet's constructor set its name) but either
my registration is ignored or its overridden by the AccessInterceptor's.
I know that I could use some fancy JavaScript on the client browser
to combine two of the fields into one, but I would prefer to just override
the j_security_check processing.
I also know that I could replace the AccessInterceptor, but copying
this class just to replace one function call in the contextInit method seems
a little excessive.
I'm using the Tomcat 3.2.1 binary and sources. Moving to Tomcat 3.3
is an option, but I would prefer not to move to that unless it will solve my
problem. Tomcat 4 is not an option at this point in time.
So, there's my challenge. Is anyone up to helping me solve it?
Randy
Re: Servlet Reloading in Tomcat 3.2.2
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Fri, 10 Aug 2001, srini wrote:
> hi satya,
> ho sorry it is .class not .java
> package is something com.srini.MyClass but still it is not reloading.
>
There's two important details:
* The actual class file would have to be
"/WEB-INF/classes/com/srini/MyClass.class" in this case -- the
directory hierarchy has to conform to the package hierarchy
in the usual Java fashion. I imagine you have this right or
it would not have worked in the first place.
* Tomcat 3.2.x has problems consistently recognizing updated classes
*other than* servlets. This is a consequence of some fundamental
design choices that it's unlikely will be changed (given that
there are new versions of Tomcat available). Tomcat 4 does this
correctly.
> regards
> -srini
>
Craig
> ----- Original Message -----
> From: "Satyan Nair" <sa...@cobite.com>
> To: <to...@jakarta.apache.org>
> Sent: Friday, August 10, 2001 4:44 PM
> Subject: RE: Servlet Reloading in Tomcat 3.2.2
>
>
> > it must be .class and not .JAVA files in the WEB-INF/classes directory...
> > which means compiled classes ... tomcat does not compile it i guess... not
> > yet...
> > suggestion would be to put the compiled classes under a package
> > com.srini.myClass
> >
> >
> > take care...
> > satya...
> > -----Original Message-----
> > From: srini [mailto:srinivas@ensoftek.com]
> > Sent: Friday, August 10, 2001 1:46 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Servlet Reloading in Tomcat 3.2.2
> >
> >
> > hi ,
> > iam running my project under <TOMCAT_HOME>\ myproj and
> > context is set something like this
> >
> > <Context path="/purejsp"
> > docBase="purejsp"
> > crossContext="false"
> > debug="0"
> > reloadable="true">
> > </Context>
> > and my .JAVA files are located under myproj\WEB-INF\classes. But my
> > servlet is not reloading. What could be the problem ????
> > If this question is already posted please give me the link.
> > thanks for the help inadvance.
> >
> > regards
> > -srini
> >
> >
>
>
Re: Servlet Reloading in Tomcat 3.2.2
Posted by srini <sr...@ensoftek.com>.
hi satya,
ho sorry it is .class not .java
package is something com.srini.MyClass but still it is not reloading.
regards
-srini
----- Original Message -----
From: "Satyan Nair" <sa...@cobite.com>
To: <to...@jakarta.apache.org>
Sent: Friday, August 10, 2001 4:44 PM
Subject: RE: Servlet Reloading in Tomcat 3.2.2
> it must be .class and not .JAVA files in the WEB-INF/classes directory...
> which means compiled classes ... tomcat does not compile it i guess... not
> yet...
> suggestion would be to put the compiled classes under a package
> com.srini.myClass
>
>
> take care...
> satya...
> -----Original Message-----
> From: srini [mailto:srinivas@ensoftek.com]
> Sent: Friday, August 10, 2001 1:46 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Servlet Reloading in Tomcat 3.2.2
>
>
> hi ,
> iam running my project under <TOMCAT_HOME>\ myproj and
> context is set something like this
>
> <Context path="/purejsp"
> docBase="purejsp"
> crossContext="false"
> debug="0"
> reloadable="true">
> </Context>
> and my .JAVA files are located under myproj\WEB-INF\classes. But my
> servlet is not reloading. What could be the problem ????
> If this question is already posted please give me the link.
> thanks for the help inadvance.
>
> regards
> -srini
>
>
RE: Servlet Reloading in Tomcat 3.2.2
Posted by Satyan Nair <sa...@cobite.com>.
it must be .class and not .JAVA files in the WEB-INF/classes directory...
which means compiled classes ... tomcat does not compile it i guess... not
yet...
suggestion would be to put the compiled classes under a package
com.srini.myClass
take care...
satya...
-----Original Message-----
From: srini [mailto:srinivas@ensoftek.com]
Sent: Friday, August 10, 2001 1:46 PM
To: tomcat-user@jakarta.apache.org
Subject: Servlet Reloading in Tomcat 3.2.2
hi ,
iam running my project under <TOMCAT_HOME>\ myproj and
context is set something like this
<Context path="/purejsp"
docBase="purejsp"
crossContext="false"
debug="0"
reloadable="true">
</Context>
and my .JAVA files are located under myproj\WEB-INF\classes. But my
servlet is not reloading. What could be the problem ????
If this question is already posted please give me the link.
thanks for the help inadvance.
regards
-srini
Servlet Reloading in Tomcat 3.2.2
Posted by srini <sr...@ensoftek.com>.
hi ,
iam running my project under <TOMCAT_HOME>\ myproj and
context is set something like this
<Context path="/purejsp"
docBase="purejsp"
crossContext="false"
debug="0"
reloadable="true">
</Context>
and my .JAVA files are located under myproj\WEB-INF\classes. But my
servlet is not reloading. What could be the problem ????
If this question is already posted please give me the link.
thanks for the help inadvance.
regards
-srini