Struts + Tiles: New Session on every request?

D

Danny Gerst

Hi @all!

I converted the layout of a webapplikation from framebased to Tiles. Now
I got the problem, that the server creates a new session on every
request. That really strange. I converted strutsprojects before and none
of of them behave like this.

At the beginning I started to wonder, that the content of all formbeans
were not saved over the span of two requests. After some debugging I
realized that the session was not the same.

If I avoided Tiles for one action for example, everything works fine for
this action. But as I started to define the Forward again over Tiles,
the problem arise again.

Since Google did not help me, I thought it might be a really strange
problem. I thought it might be the applikation causing the session to be
destroyed. But nowhere in the code I find something like
session.invalidate(). The only thing I find is
request.getSession(true);, but this command should not be any problem.

For the whole request the session stays the same. Only if a new request
is invoked the session is new. I can not imagine where to start to find
the cause of the behavior. Maybe someone has a clue or an advice where
to start to solve this problem.

The platform is WS 6.1.


Thx in advanced,

Danny
 
Joined
Mar 2, 2012
Messages
1
Reaction score
0
Tiles New Session on every request

listen:
instead of using
request.setAttribute(arg0, arg1);
or
session.setAttribute(arg0,obj);

use

request.getSession().setAttribute(arg0, arg1);

this is working code for maintaining session information

and accessing the value use

:guru::guru:request.getSession().getAttribute(arg0);:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top