tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trond Hersløv <trond.hers...@gotogate.no>
Subject Re: HttpSession
Date Fri, 02 Jul 2004 14:21:43 GMT
Thanks alot Mike,
I will try this out during the day and let you if I was successfull or not.

\trond


-----Opprinnelig melding-----
Fra: Mike Fowler [mailto:tomcat-user@mlfowler.com]
Sendt: Friday, July 02, 2004 11:04
Til: Tomcat Users List
Emne: Re: HttpSession


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


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message