tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnny Kewl" <>
Subject Re: Bean in session scope
Date Sun, 06 Jul 2008 17:49:09 GMT

----- Original Message ----- 
From: "Axel Leucht" <>
To: "Tomcat Users List" <>
Sent: Sunday, July 06, 2008 6:05 PM
Subject: Bean in session scope

> I'm currently operating an Apache webserver 2.2.4 in front of an Apache
> tomcat 6.0.16. Both are working together via mod_proxy.
> I'm trying to execute the NumberGuess sample provided with tomcat via the
> webserver.
> I can access the webapp successfully. The jsp page declares a bean in
> session scope <jsp:useBean id="numguess" class="num.NumberGuessBean"
> scope="session"/> and doesn't work as any request creates a new Java-Bean!
> I can confirm that the constructor is run with any request, hence setting
> numGuesses to 0 and a new answer to find.
> When I change to scope="application", it works and of course everything
> works also when executed directly when accessing via tomcat.
> Can someone tell me what is wrong in my configuration?
> Here are the relevant lines in my httpd.conf:
> <Proxy balancer://mycluster>
> BalancerMember ajp:// route=checkov
> keepalive=On retry=30 ttl=60
> </Proxy>
> <Location /foo>
> ProxyPass balancer://mycluster/examples/jsp/
> stickysession=JSESSIONID timeout=5
> </Location>

I'm a JK kinda guy... the reason is that JK is made by TC guys, mod_proxy is 
Apaches way, but hey apche is pretty hot... so here a huge guess... you got 
one machine, you dont need all the hassle of stickyness...

Try this...

<Location /examples/>
ProxyPass http://localhost:8080/examples/
ProxyPassReverse http://localhost:8080/examples/

and try this for AJP...

<Location /examples/>
   ProxyPass ajp://localhost:8009/examples/

cookies must get thru...

then try

<Proxy balancer://myCluster>
   BalancerMember ajp://localhost:8009
<Location /examples/>
    ProxyPass balancer://myCluster/examples/

On a single machine you dont need to bother with sticky sessions....
If no work... something else is wrong, like maybe cookies off in browser....
... a guess ;)

The most powerful application server on earth.
The only real POJO Application Server.
See it in Action :

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message