• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Passing Data between JSPs

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are creating a payroll time entry application for the web.
Background:
We have the employee logging in, getting time information for the employee and storing it into objects. Then we ask the employee to pick between approving time (managers only) and entering time (all have this choice). We use a forward to send the employee to the time entry screen jsp, and we pass the initial objects on.
Problem:
When the employee enters time, we update the time vector. When we save the time data, then return to the time entry display, the modified time entry data does not display - it does show back on the screen what we changed in the time vector.
Question:
When you pass out an object, how can you update the object, or do you need to delete it and then re-read the data to pick up the changed information from the database?
Is it tied to how we may be keeping track of our session that we are in? How do you get the session ID and then pass it between jsp's?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As long as all JSP are in the same "web application" you should automatically get the right session.
How are you passing objects around? In the session or in the request?
Is the "return to the time entry display" really calling the JSP again or is the browser using a cached copy?
Bill
 
Kerry Shannon
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We were using the session, but now are trying to use the request, because we thought we needed to do that because some of the 'value' methods are depricated so we are moving to the 'attribute' methods.
We believe the browser is using a cached copy, not calling the JSP again.
How should we be doing this?
 
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kerry,
Please refer to this thread. Many suggestions are there. Especially by adding ?dummy=123 at end of URL. http://www.javaranch.com/ubb/Forum7/HTML/000520.html
regds
maha anna
 
Kerry Shannon
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, this seems to be working, although I'm not certain we did it this way.
Javaranch seems to have great information for our problems.
Thanks. You can close this topic.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This might be a little off topic, but I have a somewhat related problem. I'm writing a login application that moves through a set of JSPs, and launches an applet on successful login. The concern is that if someone successfully logs in and runs the applet, then logs out, someone else could come up to the computer if the browser is left running and use the Back and Forward browser buttons to essentially relogin. It doesn't appear that the JSPs are re-executing when going back to a page using the browser buttons, based on some print statements I have. On logout I do a showDocument back to the initial login page, but the applet will re-execute if you use the Back button.
Is there a way to catch the browser Forward and Back button clicks in the JSP, so I can try to prevent someone reloading a successful login page? I tried the "no-cache" code from the thread that Maha Anna mentioned, but as I said above, it seems like the files aren't uncached (even when using ?dummy=123) since it's not really executing my JSPs to move between pages.
Thanks for any assistance/suggestions.
reply
    Bookmark Topic Watch Topic
  • New Topic