You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by David Gagnon <dg...@siunik.com> on 2006/04/06 21:06:13 UTC

How do disable session in tomcat 5.5?

Hi,

  I need to have a sessionless tomcat.  I surely easy to do but I'm 
searching without success for a while now.

I need a servlet without session.


Thanks for your help
Best regards
/David

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


Re: How do disable session in tomcat 5.5?

Posted by David Gagnon <dg...@siunik.com>.
Leon Rosenberg wrote:

>Well, if you don't need the session just forget about it :-)
>If you don't put anything into session and aren't using it in any
>other way, why should there be a memory leak?
>  
>
Maybe a misunderstanding from me but I tought Tomcat will keep session 
info on each connection for a given time (let say 15 minutes).  So if 
1000 uses ask for a report in 15 minute it's 1000 session object.  But 
my numbers are too high anyway so probably this leak is not a problem .. 
if leak exists :-)

Regards
/David


>regards
>Leon
>
>
>On 4/7/06, David Gagnon <dg...@siunik.com> wrote:
>  
>
>>Hi,
>>
>>    
>>
>>>Check the javadocs:
>>>
>>>http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletRequest.html#getSession()
>>>
>>>Returns the current session associated with this request, or if the
>>>request does not have a session, creates one.
>>>
>>>If you don't want a session call getSession(false) or don't call the
>>>method at all. As far as I know the webapp will be sessionless as long
>>>as you don't call getSession() on request object and put
>>>session="false" in all your jsps (otherwise in the generated java
>>>servlet HttpSession session = request.getSession(); will be called).
>>>
>>>
>>>      
>>>
>>Thanks I was looking for doing the JSP <%@ page session="true"  %>
>>equivalent .. but in servlet
>>
>>
>>    
>>
>>>Another question, what's your goal? Why do you need explicitely
>>>sessionless servlets so badly? Isn't it sufficent just not to use the
>>>session if you don't need it?
>>>
>>>
>>>      
>>>
>>I want to use Tomcat to hold a reportServer.  It will receive request
>>from different users from different webApp to craft reports.  It needs
>>to be sessionless,  in fact since I don't need session I just wanted to
>>avoid a memory leak...
>>
>>Thanks for your help
>>/David
>>
>>
>>
>>    
>>
>>>regards
>>>Leon
>>>
>>>On 4/7/06, David Gagnon <dg...@siunik.com> wrote:
>>>
>>>
>>>      
>>>
>>>>In fact I need to know How to have a sessionless Servlet?  I search the
>>>>tomcat source and it seems I have nothing to do.  But when I do a
>>>>request.getSession()  I do receive a session object?  Is that normal
>>>>behavior?
>>>>
>>>>Thanks for your help
>>>>/David
>>>>
>>>>
>>>>
>>>>Franck Borel wrote:
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>>>Use <%@ page session="false"> in your jsp sites.
>>>>>
>>>>>-- Franck
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>>>Hi,
>>>>>>
>>>>>>I need to have a sessionless tomcat.  I surely easy to do but I'm
>>>>>>searching without success for a while now.
>>>>>>
>>>>>>I need a servlet without session.
>>>>>>
>>>>>>
>>>>>>Thanks for your help
>>>>>>Best regards
>>>>>>/David
>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>>>>>
>>>>>------------------------------------------------------------------------
>>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>
>>>>
>>>>        
>>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>
>>>
>>>
>>>
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>  
>



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


Re: How do disable session in tomcat 5.5?

Posted by Leon Rosenberg <ro...@googlemail.com>.
Well, if you don't need the session just forget about it :-)
If you don't put anything into session and aren't using it in any
other way, why should there be a memory leak?

regards
Leon


On 4/7/06, David Gagnon <dg...@siunik.com> wrote:
> Hi,
>
> >Check the javadocs:
> >
> >http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletRequest.html#getSession()
> >
> >Returns the current session associated with this request, or if the
> >request does not have a session, creates one.
> >
> >If you don't want a session call getSession(false) or don't call the
> >method at all. As far as I know the webapp will be sessionless as long
> >as you don't call getSession() on request object and put
> >session="false" in all your jsps (otherwise in the generated java
> >servlet HttpSession session = request.getSession(); will be called).
> >
> >
> Thanks I was looking for doing the JSP <%@ page session="true"  %>
> equivalent .. but in servlet
>
>
> >Another question, what's your goal? Why do you need explicitely
> >sessionless servlets so badly? Isn't it sufficent just not to use the
> >session if you don't need it?
> >
> >
> I want to use Tomcat to hold a reportServer.  It will receive request
> from different users from different webApp to craft reports.  It needs
> to be sessionless,  in fact since I don't need session I just wanted to
> avoid a memory leak...
>
> Thanks for your help
> /David
>
>
>
> >regards
> >Leon
> >
> >On 4/7/06, David Gagnon <dg...@siunik.com> wrote:
> >
> >
> >>In fact I need to know How to have a sessionless Servlet?  I search the
> >>tomcat source and it seems I have nothing to do.  But when I do a
> >>request.getSession()  I do receive a session object?  Is that normal
> >>behavior?
> >>
> >>Thanks for your help
> >>/David
> >>
> >>
> >>
> >>Franck Borel wrote:
> >>
> >>
> >>
> >>>Use <%@ page session="false"> in your jsp sites.
> >>>
> >>>-- Franck
> >>>
> >>>
> >>>
> >>>>Hi,
> >>>>
> >>>> I need to have a sessionless tomcat.  I surely easy to do but I'm
> >>>>searching without success for a while now.
> >>>>
> >>>>I need a servlet without session.
> >>>>
> >>>>
> >>>>Thanks for your help
> >>>>Best regards
> >>>>/David
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>>>For additional commands, e-mail: users-help@tomcat.apache.org
> >>>>
> >>>>
> >>>>
> >>>>
> >>>------------------------------------------------------------------------
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>>For additional commands, e-mail: users-help@tomcat.apache.org
> >>>
> >>>
> >>>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >>For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >>
> >>
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: How do disable session in tomcat 5.5?

Posted by David Gagnon <dg...@siunik.com>.
Hi,

>Check the javadocs:
>
>http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletRequest.html#getSession()
>
>Returns the current session associated with this request, or if the
>request does not have a session, creates one.
>
>If you don't want a session call getSession(false) or don't call the
>method at all. As far as I know the webapp will be sessionless as long
>as you don't call getSession() on request object and put
>session="false" in all your jsps (otherwise in the generated java
>servlet HttpSession session = request.getSession(); will be called).
>  
>
Thanks I was looking for doing the JSP <%@ page session="true"  %> 
equivalent .. but in servlet


>Another question, what's your goal? Why do you need explicitely
>sessionless servlets so badly? Isn't it sufficent just not to use the
>session if you don't need it?
>  
>
I want to use Tomcat to hold a reportServer.  It will receive request 
from different users from different webApp to craft reports.  It needs 
to be sessionless,  in fact since I don't need session I just wanted to 
avoid a memory leak...

Thanks for your help
/David



>regards
>Leon
>
>On 4/7/06, David Gagnon <dg...@siunik.com> wrote:
>  
>
>>In fact I need to know How to have a sessionless Servlet?  I search the
>>tomcat source and it seems I have nothing to do.  But when I do a
>>request.getSession()  I do receive a session object?  Is that normal
>>behavior?
>>
>>Thanks for your help
>>/David
>>
>>
>>
>>Franck Borel wrote:
>>
>>    
>>
>>>Use <%@ page session="false"> in your jsp sites.
>>>
>>>-- Franck
>>>
>>>      
>>>
>>>>Hi,
>>>>
>>>> I need to have a sessionless tomcat.  I surely easy to do but I'm
>>>>searching without success for a while now.
>>>>
>>>>I need a servlet without session.
>>>>
>>>>
>>>>Thanks for your help
>>>>Best regards
>>>>/David
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>>
>>>>
>>>>        
>>>>
>>>------------------------------------------------------------------------
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>>For additional commands, e-mail: users-help@tomcat.apache.org
>>>
>>>      
>>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>>For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>>    
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>
>  
>



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


Re: How do disable session in tomcat 5.5?

Posted by Leon Rosenberg <ro...@googlemail.com>.
Check the javadocs:

http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletRequest.html#getSession()

Returns the current session associated with this request, or if the
request does not have a session, creates one.

If you don't want a session call getSession(false) or don't call the
method at all. As far as I know the webapp will be sessionless as long
as you don't call getSession() on request object and put
session="false" in all your jsps (otherwise in the generated java
servlet HttpSession session = request.getSession(); will be called).

Another question, what's your goal? Why do you need explicitely
sessionless servlets so badly? Isn't it sufficent just not to use the
session if you don't need it?

regards
Leon

On 4/7/06, David Gagnon <dg...@siunik.com> wrote:
> In fact I need to know How to have a sessionless Servlet?  I search the
> tomcat source and it seems I have nothing to do.  But when I do a
> request.getSession()  I do receive a session object?  Is that normal
> behavior?
>
> Thanks for your help
> /David
>
>
>
> Franck Borel wrote:
>
> > Use <%@ page session="false"> in your jsp sites.
> >
> > -- Franck
> >
> >> Hi,
> >>
> >>  I need to have a sessionless tomcat.  I surely easy to do but I'm
> >> searching without success for a while now.
> >>
> >> I need a servlet without session.
> >>
> >>
> >> Thanks for your help
> >> Best regards
> >> /David
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >> For additional commands, e-mail: users-help@tomcat.apache.org
> >>
> >>
> >
> >
> >------------------------------------------------------------------------
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> >For additional commands, e-mail: users-help@tomcat.apache.org
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: How do disable session in tomcat 5.5?

Posted by David Gagnon <dg...@siunik.com>.
In fact I need to know How to have a sessionless Servlet?  I search the 
tomcat source and it seems I have nothing to do.  But when I do a 
request.getSession()  I do receive a session object?  Is that normal 
behavior?

Thanks for your help
/David



Franck Borel wrote:

> Use <%@ page session="false"> in your jsp sites.
>
> -- Franck
>
>> Hi,
>>
>>  I need to have a sessionless tomcat.  I surely easy to do but I'm 
>> searching without success for a while now.
>>
>> I need a servlet without session.
>>
>>
>> Thanks for your help
>> Best regards
>> /David
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
>
>------------------------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>



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


Re: How do disable session in tomcat 5.5?

Posted by Franck Borel <bo...@ub.uni-freiburg.de>.
Use <%@ page session="false"> in your jsp sites.

-- Franck
> Hi,
>
>  I need to have a sessionless tomcat.  I surely easy to do but I'm 
> searching without success for a while now.
>
> I need a servlet without session.
>
>
> Thanks for your help
> Best regards
> /David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
====================================================================
Dipl.-Hyd. Franck Borel               Universitaetsbibliothek Freiburg
EMail: borel@ub.uni-freiburg.de       EDV-Dezernat
Tel. : +49-761 / 203-3908             Werthmannplatz 2 | Postfach 1629
Fax  : +49-761 / 203-3987             79098 Freiburg   | 79016 Freiburg