JSP / Restart a session or create a new one

Discussion in 'Java' started by Larry Yondespor, Feb 5, 2005.

  1. Hi,
    I work on a JSP project where my users send work
    from a browser to legacy Unix scripts through a servlet.
    When the work is completed, there is a Web page that appears
    to on screen of the user for him to approve the results
    of the work performed. If the user is not at his desk
    the approval form stays on the user's monitor until and after
    the session times out. When that happens the user cannot
    use the form to approve the work. Is there a way to create
    a new session on submit of a form if the session has timed out?
    What would be the trick you would use?

    Thanks

    Larry
     
    Larry Yondespor, Feb 5, 2005
    #1
    1. Advertising

  2. Larry Yondespor

    Wendy S Guest

    "Larry Yondespor" <> wrote

    > Is there a way to create a new session on submit of a form if the session
    > has timed out?


    What code are you using to get a reference to the session? There are two
    signatures for 'getSession' (one that takes a boolean and one with no args).
    Unless you're calling request.getSession( false ), a new session WILL be
    created. My guess is that you're already getting a new session, the problem
    is that since it's new, it's missing whatever you needed to be in there.

    > What would be the trick you would use?


    First I would lengthen the session timeout for this webapp in web.xml. (I
    think the default is 30 minutes.) Then I would attempt to educate the users
    that they cannot just leave for hours and expect things to work when they
    get back.

    If that doesn't work, I would switch to a different model, one where job
    submission is separate from approval. They would use one page to submit a
    job, and a separate one to get a list of the things that need approval.

    --
    Wendy
     
    Wendy S, Feb 5, 2005
    #2
    1. Advertising

  3. Changing model for JSP / Restart a session or create a new one

    Agree, switching to a different model is
    probably the thing to do, since the users
    like to send a job before they leave work at
    5:00; to then approve the work done when they
    come back to work on the next morning.

    Thanks

    ===================================

    On Fri, 04 Feb 2005 18:57:21 -0700, Wendy S wrote:

    > "Larry Yondespor" <> wrote
    >
    >> Is there a way to create a new session on submit of a form if the session
    >> has timed out?

    >
    > What code are you using to get a reference to the session? There are two
    > signatures for 'getSession' (one that takes a boolean and one with no args).
    > Unless you're calling request.getSession( false ), a new session WILL be
    > created. My guess is that you're already getting a new session, the problem
    > is that since it's new, it's missing whatever you needed to be in there.
    >
    >> What would be the trick you would use?

    >
    > First I would lengthen the session timeout for this webapp in web.xml. (I
    > think the default is 30 minutes.) Then I would attempt to educate the users
    > that they cannot just leave for hours and expect things to work when they
    > get back.
    >
    > If that doesn't work, I would switch to a different model, one where job
    > submission is separate from approval. They would use one page to submit a
    > job, and a separate one to get a list of the things that need approval.
     
    Larry Yondespor, Feb 5, 2005
    #3
  4. Larry Yondespor

    Ryan Stewart Guest

    "Larry Yondespor" <> wrote in message
    news:p...
    > Hi,
    > I work on a JSP project where my users send work
    > from a browser to legacy Unix scripts through a servlet.
    > When the work is completed, there is a Web page that appears
    > to on screen of the user for him to approve the results
    > of the work performed. If the user is not at his desk
    > the approval form stays on the user's monitor until and after
    > the session times out. When that happens the user cannot
    > use the form to approve the work. Is there a way to create
    > a new session on submit of a form if the session has timed out?
    > What would be the trick you would use?
    >

    You might look into the various Listeners in javax.servlet.http. Perhaps when a
    session times out you could save the data and reload it when the user signs back
    in.
     
    Ryan Stewart, Feb 5, 2005
    #4
  5. Larry Yondespor

    Malte Guest

    Wendy S wrote:
    > "Larry Yondespor" <> wrote
    >
    >


    >
    > If that doesn't work, I would switch to a different model, one where job
    > submission is separate from approval. They would use one page to submit a
    > job, and a separate one to get a list of the things that need approval.
    >


    I agree with the proposal to switch to a model more natural to the web.
    Add a little authentication mechanism so you dont' have to rely on
    sessions. Or simply use JavaMail to send them a message they can reply to.
     
    Malte, Feb 5, 2005
    #5
    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. sridhar kumar ch
    Replies:
    1
    Views:
    8,753
  2. sridhar kumar ch
    Replies:
    0
    Views:
    826
    sridhar kumar ch
    Jun 28, 2006
  3. Replies:
    2
    Views:
    824
  4. albertly
    Replies:
    3
    Views:
    14,233
    Steven Cheng[MSFT]
    Feb 8, 2008
  5. Josef Moellers

    Restart Perl Application upon KDE Restart

    Josef Moellers, Jul 18, 2013, in forum: Perl Misc
    Replies:
    18
    Views:
    310
    Adam H. Kerman
    Jul 26, 2013
Loading...

Share This Page