Yogesh Kapoor

Greenhorn
+ Follow
since May 01, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Yogesh Kapoor

Hi all,
I have a requirenent in my project where i have some screen for the user to fill in the data and stote them in the database.Now the problem is that in the biginning i present an empty form to the user(page 1 in browser) , the user fills in the data and hits on the save button, i save the data in a table and again show the same form to the user but this time filled in with the data he/she had wanted to save(page 2 in browser). Now what the user does is he/she presses the back button of the borwser and goes back to page 1 and sees the same empty form again.
To avoid this i used the following segemnt of code in my JSPs.......
<%
response.addHeader("Pragma", "NoCache");
response.addHeader("Cache-Control", "no-cache");
response.addDateHeader("Expires", 1);
%>
This works , but now when the user presses the back button after saving the record he/she gets the following warning page....
-----------------------------
Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.
To resubmit your information and view this Web page, click the Refresh button.
-----------------------------
Is there any more decent way to achieve this , so that the page 1 is removed from the history entirely..
Thanks
Yogesh
23 years ago
Hi all,
I have a requirenent in my project where i have some screen for the user to fill in the data and stote them in the database.Now the problem is that in the biginning i present an empty form to the user(page 1 in browser) , the user fills in the data and hits on the save button, i save the data in a table and again show the same form to the user but this time filled in with the data he/she had wanted to save(page 2 in browser). Now what the user does is he/she presses the back button of the borwser and goes back to page 1 and sees the same empty form again.
To avoid this i used the following segemnt of code in my JSPs.......
<%
response.addHeader("Pragma", "NoCache");
response.addHeader("Cache-Control", "no-cache");
response.addDateHeader("Expires", 1);
%>
This works , but now when the user presses the back button after saving the record he/she gets the following warning page....
-----------------------------
Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you.
To resubmit your information and view this Web page, click the Refresh button.
-----------------------------
Is there any more decent way to achieve this , so that the page 1 is removed from the history entirely..
Thanks
Yogesh
23 years ago
First of all , you must place your class files in the class path of your server. Then the server will always load your custom class and make it available for use in your jsp.
also if you are using package(looks like you kave your class in a package names counter), then you must instantiate the bean using
<jsp:useBean id="counter" scope="session" class="counter.Counter" />
23 years ago
The checkbox values become a part of the request only when the checkbox is checked(set). Assigning a value to the checkbox does not matter. If the checkbox is not checked the request.getParameter() will always return null as there would be no parameter in the request with the name of your checkbox.
23 years ago
Hi Peter,
Thanks a lot, your suggestions have helped me a lot.
Regards,
Yogesh
23 years ago
I am using a customized jdbc api, which allows only one resultset and one statement object per connection object.I have a page(with two frames) where i accept some search criteria from the user(on the top frame) , do the search in the database and display the list of records found in bottom frame.But the problerm occurs when the user hits the search button multiple times , as in that case i receive an exception because my api allows only one resultset object open and a resultset object from my previous request was already open.I am making the database call in an beans and returning resultset object to the JSP. But i am not able to figure out that when a user hits the search(submit) button multiple times(say twice) how much my first request had progressed before getting terminated. Can i find this in any way , so that i can close my JDBC objetcs before the next request starts executing.
23 years ago