tomcat-users mailing list archives

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

----- Original Message ----- 
From: "Axel Leucht" <axel.leucht@dokom.net>
To: "Tomcat Users List" <users@tomcat.apache.org>
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://192.168.0.101:8009 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/
</Location>

and try this for AJP...

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

cookies must get thru...

then try

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

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 ;)

---------------------------------------------------------------------------
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
--------------------------------------------------------------------------- 


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


Mime
View raw message