You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Trond Hersløv <tr...@gotogate.no> on 2004/07/02 09:31:10 UTC
HttpSession
Hi!
What do I have to do if want to use a modified HttpSession class? Can I do
one of the following:
Hope I don't have to do it this way:
1) extract $CATALINA_HOME/common/lib/servlet-api.jar
2) decompile HttpSession.class --> HttpSession.java
3) make my modifications on HttpSession.java and compile -->
HttpSession.class
4) build a new servlet-api.jar containing the modified HttpSession.class
instead of the original one.
It would be nice if this was possible.
1) create a new class MyHttpSession which extends HttpSession
2) add my extra funcionality to MyHttpSession.
3) compile MyHttpSession --> MyHttpSession.class and putt it into
$CATALINA_HOME/common/classes
4)The big QUESTION: How do I config tomcat to use MyHttpSession.class
instead of HttpSession.
Thanks in advance
\trond
**********************************************************************
This email message has been swept by
MIMEsweeper for the presence of computer viruses.
**********************************************************************
Re: HttpSession
Posted by Mike Fowler <to...@mlfowler.com>.
Trond-
HttpSession.class in servlet-api.jar is an interface as is implemented
in several places in the Tomcat source. To add new functionality I would
make changes to the following classes and recompile Tomcat:
-javax.servlet.http.HttpSession.java
add your new methods:
public void myHelperMethod();
-org.apache.catalina.session.StandardSession.java
implement your new method:
public void myHelperMethod()
{
//useful code
}
-org.apache.catalina.session.StandardSessionFacade.java
add the lines:
public void myHelperMethod()
{
this.session.myHelperMethod();
}
-org.apache.catalina.cluster.session.DeltaSession.java
implement your new method:
public void myHelperMethod()
{
//useful code
}
-org.apache.catalina.cluster.session.DeltaSessionFacade.java
add the lines:
public void myHelperMethod()
{
this.session.myHelperMethod();
}
Hope this helps!
-Mike Fowler
"I could be a genius if I just put my mind to it, and I,
I could do anything, if only I could get 'round to it"
Trond Hersløv wrote:
> Hi!
> What do I have to do if want to use a modified HttpSession class? Can I do
> one of the following:
>
> Hope I don't have to do it this way:
> 1) extract $CATALINA_HOME/common/lib/servlet-api.jar
> 2) decompile HttpSession.class --> HttpSession.java
> 3) make my modifications on HttpSession.java and compile -->
> HttpSession.class
> 4) build a new servlet-api.jar containing the modified HttpSession.class
> instead of the original one.
>
> It would be nice if this was possible.
> 1) create a new class MyHttpSession which extends HttpSession
> 2) add my extra funcionality to MyHttpSession.
> 3) compile MyHttpSession --> MyHttpSession.class and putt it into
> $CATALINA_HOME/common/classes
> 4)The big QUESTION: How do I config tomcat to use MyHttpSession.class
> instead of HttpSession.
>
> Thanks in advance
> \trond
>
>
>
>
>
> **********************************************************************
> This email message has been swept by
> MIMEsweeper for the presence of computer viruses.
> **********************************************************************
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org