473,385 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Jsp Refresh problem

rsrinivasan
221 100+
Hi all,

I have problem in my JSP page.

When i press F5 button, it resubmits the page once again and adds the same record once again. But i do not want this one. If you have any idea on this let me know.

Thanks,
Srinivasan R.
Aug 16 '07 #1
5 5670
r035198x
13,262 8TB
Hi all,

I have problem in my JSP page.

When i press F5 button, it resubmits the page once again and adds the same record once again. But i do not want this one. If you have any idea on this let me know.

Thanks,
Srinivasan R.
Give the submit button a name and set a value on it when it's submitted by clicking the button. If the page was submitted by refresh that value won't be set.
Aug 16 '07 #2
praveen2gupta
201 100+
Hi all,

I have problem in my JSP page.

When i press F5 button, it resubmits the page once again and adds the same record once again. But i do not want this one. If you have any idea on this let me know.

Thanks,
Srinivasan R.
Hi
pls show your jsp code and display the recoreds which yoy are getting repeated.
Aug 16 '07 #3
rsrinivasan
221 100+
Hi
pls show your jsp code and display the recoreds which yoy are getting repeated.
Hi,

Thanks for your reply. I cant send it all. Because it is large file.
What i have the problem is,
1. When i click the add button, it sets "formActions" as 'add' and submit it to the corresponding action class.
2. And in the action class, i check the variable formActions is 'add' or anyother.
3. If "formActions" is 'add', then it will add some field in a table.
4. Here everything is good what i expect.

5. But the problem is, now i press F5 button or right click my mouse and press refresh button, it adds one more time the same record into the table.

6. Because the "actionForm" value is still have the same value 'add'.
7. How to resolve the problem.

Thanks,
Srinivasan R.
Aug 16 '07 #4
r035198x
13,262 8TB
Hi,

Thanks for your reply. I cant send it all. Because it is large file.
What i have the problem is,
1. When i click the add button, it sets "formActions" as 'add' and submit it to the corresponding action class.
2. And in the action class, i check the variable formActions is 'add' or anyother.
3. If "formActions" is 'add', then it will add some field in a table.
4. Here everything is good what i expect.

5. But the problem is, now i press F5 button or right click my mouse and press refresh button, it adds one more time the same record into the table.

6. Because the "actionForm" value is still have the same value 'add'.
7. How to resolve the problem.

Thanks,
Srinivasan R.
Like I said, onClick of the submit button, set a flag on a field that you also submit and check for that flag.
Aug 16 '07 #5
nasrin
1
hello dear!
After I add a record on the jsp page .. if a person happens to refresh the browser a new record is added to database... How do I prevent this?
I have used javascript ofcourse to disable right click but I cannot disable the refresh button since I am not opening it from a link but its a form submit... Is there any other better solution to this?

Your input is really appreciated
Aug 21 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Mark | last post by:
I have a working PHP/MySQL application used for data entry. The data entry screen includes a "Save" button. The PHP code for this button looks like this: if (isset($_POST)) { if ($_POST ==...
4
by: Noel Wood | last post by:
Hello, I have a problem that I'm sure is simple but I have searched the newsgroup and have not found it posted before so I apologize if it has been asked heaps of times before. I have a page that...
3
by: Scott | last post by:
I have a clickable graph that resides on page 1. If user clicks a data point on the graph, the page runs again yeilding a 2nd graph that shows a more detailed graph. Problem is, I have a...
5
by: Steve | last post by:
Hi, I have a private website for 20 people that is similar to a web email client like hotmail. There are two frames, one on the left with links for "New", "History", "Todays" and a frame on the...
12
by: Tarken | last post by:
Hi, I am trying to do some refactoring of a web site to ensure that it displays in the most web clients possible. One of the pages requires to be redirected to another automatically, for one...
4
by: Andrew Alger | last post by:
ok i have two forms. Customer.aspx and Parent_Searh.aspx. There is a button on Customer.aspx that when executed runs javascript code to open up parent_search as a popup. After the user searches...
10
by: tasmisr | last post by:
This is an old problem,, but I never had it so bad like this before,, the events are refiring when clicking the Browser refresh button. In the Submit button in my webform, I capture the server side...
1
by: ppatel | last post by:
Problem I have a problem with web image button control click event. The click event does not get trigger until it has not been clicked once or page refresh occures(which is fine). When click...
7
by: Juan Romero | last post by:
Hey guys, please HELP I am going nuts with the datagrid control. I cannot get the damn control to refresh. I am using soap to get information from a web service. I have an XML writer output...
12
by: martin1 | last post by:
All, is there window form refresh property? I try to set up window form refresh per minute. Thanks
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.