Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form Servlet...

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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,


 
paul wheaton
Trailboss
Pie
Posts: 21896
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure, but it sounds like you are suggesting some fancy javascript stuff, yes?
 
Todd Bush
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks Todd,
Will give it a try!
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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.")

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic