?
Solved

how to make navigation of pages easy without losing variable values in between?

Posted on 2006-05-03
12
Medium Priority
?
243 Views
Last Modified: 2010-04-01
dear experts,

my jsp application provides multiple "submit" functions in different pages which have to pass some values to the next pages or java classes to return the proper results. however, i don't want the users to receive error message when they just use "back button" on the browser to go back to some previous page and re-submit again since some values might not exist any more.

what should I do? what is the best way to handle case like this? should I just set all the variables to a session variables? i worry that might slow down the application and some side affect. thanks
0
Comment
Question by:dodowoman
  • 4
  • 4
  • 2
10 Comments
 
LVL 11

Accepted Solution

by:
WelkinMaze earned 300 total points
ID: 16596615
Hi,
I don't think that the session variables will slow down your application. So you can use them if you want.
But are you sure you want this. Maybe it is not a very good idea to make the things so easy with the back button for security reasons. This will make access of anyone easier from the user's computer since he only have to press back button.
But if you have not such problem to think about I think you can use session variables without worries.
0
 

Author Comment

by:dodowoman
ID: 16596896
thanks, i agree that tere is some security concern. so, what would be the best solution for this? just let your see the error page? or tell them not to use return button, but have to re-login every time? what is your suggestion?
0
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16597349
It depends primarily on what you want to achieve. You can keep their session for some time, for example 15 minutes, and after 15 minutes without activity you can close it and display some message about session timeout.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:dodowoman
ID: 16598017
thanks, but now do we set the session time?
0
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16598069
You manage the session time on the server side. Initialize a timer when the user logs in and restart it to zero everytime when he accesses the server. If the timer reach the desired time on the server you close the user session and the next time when the user request something from the server you display a "session timeout" message (with a login form if you want).
0
 

Author Comment

by:dodowoman
ID: 16598228
thanks, it does sound like a good thing to do. But, how to implement this "session management" on server side? Could you please provide some examples or info?
0
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16598295
This is a simple scheme to do it. You must already have some code that handles the login of the user. So in this code you may also initialize a counter (timer). And also you may put in your jsp pages some some code that resets this counter to zero when the page is accessed. And store this counter in the session.
0
 
LVL 1

Expert Comment

by:olgavillamizar
ID: 16600273
Are you using just JSP or you are programming using Struts??
0
 

Author Comment

by:dodowoman
ID: 16606542
Yes, I am tring to use Struts as my framework. Any advice? thanks.
0
 
LVL 1

Assisted Solution

by:olgavillamizar
olgavillamizar earned 300 total points
ID: 16609470
In the struts-config.xml you can configure the scope session to save the variables.

in the tag <action path="here the path" type="here the action" name="here the form" scope="session">
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Applications for our next round of the Experts Exchange Scholarship Contest are starting to roll in. It made us wonder what our past winners are up to these days. Here's a look at what four winners experienced with the contest and what they're doing…
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
Screencast - Getting to Know the Pipeline
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question