• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Form Servlet...

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have written a simple Form servlet,i have the code for validating the data in the doPost(), in order to output an error/updation message,i want the error message/updated changes to appear in the popup window prompting appropriate changes/updation. In order to this do i need open up different Form(Servlet form) and how do i make the control to come back to the same form? can i have multiple form tags in the doPost()?
Any suggestions,
Please let me know.
Thanks,


 
Trailboss
Posts: 23984
IntelliJ IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm not sure, but it sounds like you are suggesting some fancy javascript stuff, yes?
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've done something similar. I pass data from an Applet to a servlet, the servlet searches the database, the results are sent back and displayed in another browser instance. Basically, the applet opens the new browser using the URL of the servlet...

postData = //URL encrypted post data
URL searchURL = new URL (servletBase,"servlet/SearchServlet?"+postData);
URLConnection conn = searchURL.openConnection();

conn.setDoInput(true);
conn.setDoOutput(true);
conn.setRequestProperty("Content-Type","text/html");
//Open another browser window and show the servlet results
appletContext.showDocument(conn.getURL(),"_blank");
I know this isn't exactly what you were looking for, but it might help.
Good luck.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Todd,
Will give it a try!
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's a low-tech approach I use:
I designing my page to display the data in a table with a small column next to the field which is normally blank. When an error is detected, I rebuild my page with the word "Error" next to the field (in red). I also have a row at the top of my page that I use for error messages so that I can present the user with a detailed message (e.g. "Invalid data entered.")

 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic