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?
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12268
1
posted
0
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
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?
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.
Brett B Doehr
Greenhorn
Joined: Jun 04, 2001
Posts: 11
posted
0
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.