Struts + Tiles: New Session on every request?

Discussion in 'Java' started by Danny Gerst, Aug 29, 2007.

  1. Danny Gerst

    Danny Gerst Guest

    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
     
    Danny Gerst, Aug 29, 2007
    #1
    1. Advertising

  2. Danny Gerst

    Aniket Patil

    Joined:
    Mar 2, 2012
    Messages:
    1
    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);:
     
    Aniket Patil, Mar 2, 2012
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sean Chou

    Struts Tiles

    Sean Chou, Jul 6, 2003, in forum: Java
    Replies:
    1
    Views:
    754
    Sean Chou
    Jul 11, 2003
  2. Jack
    Replies:
    7
    Views:
    2,562
  3. Jun
    Replies:
    1
    Views:
    1,345
    Wendy S
    Nov 17, 2003
  4. Rich M
    Replies:
    0
    Views:
    2,060
    Rich M
    Mar 5, 2004
  5. TonyV
    Replies:
    19
    Views:
    954
    Mark Clements
    Mar 19, 2007
Loading...

Share This Page