• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem at Page Reloading

 
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JSP page,named entryforms.jsp. It has some input fields. After user press the submit button the JSP page send the data to servlet file named as RMAEntryServlet.java. My problem is after the datas are inserted into DB, the values in textfields in JSP page seems to be still there. I want them to vanished at page load. Even, writing a JavaScript code to be executed at body onload seems of no use.

Please help me ranchers....
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1.PRG article

2.PRG pattern

Hope This Helps
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cant get the point.. Will you please explain me clearly... Please help this noob...
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

1. submit the form(jsp) using POST method to servlet

2. in servlet: get the form data and do some business logic(iserting ,etc to the DB)

3. then REDIRECT to the success.jsp[do not use REQUESTDISPATCHER]

please do this. after that if you refresh it wont affect DB
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by seetharaman venkatasamy:
HI,

1. submit the form(jsp) using POST method to servlet

2. in servlet: get the form data and do some business logic(iserting ,etc to the DB)

3. then REDIRECT to the success.jsp[do not use REQUESTDISPATCHER]

please do this. after that if you refresh it wont affect DB


1.i do that
2.Yes i do
3.OK
4.If i use response.sendRedirect method it shows an error saying that the file name is not valid....
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you post the error message?
 
Ranch Hand
Posts: 249
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi..,

I take it that, the javascript snippet you wrote was to clean the text fields at page load...correct ? Can you try a different approach ?

Instead of trying to manually clean each and every field, try form.reset().
Just check it out.... hope that helps.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Dawn CS", please check your private messages for an important administrative matter.
 
reply
    Bookmark Topic Watch Topic
  • New Topic