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

loading one servlet from another servlet

 
mike sutton
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help loading one servlet from another servlet.
here is the code I have trying to do this. it compiles just fine but when try to submit the form I get a page not found error

please keep answer simple. I am very new to java.

_________________________________________________________________
out.println("<form name='submit' action='http://192.168.180.2/servlet/students' method='post' onsubmit='return validate()'>");

out.println("<font color='#000059' ><center>");
out.println("<font size='2' face='Arial'><center><b>Student:</b></font><br>");
out.println("<input type='text' size='25' name='student'></center><br>");
out.println("<font size='2' face='Arial'><center><b>Year in school:</b></font><br>");
out.println("<input type='text' size='25' name='year'></center><br>");
out.println("<font size='2' face='Arial'><center><b>Intended school:</b></font><br>");
out.println("<input type='text' size='25' name='school'></center><br>");
out.println("<br><center><input type='submit' name='B1' value='Submit')'>  ");
out.println("<input type='reset' name='B2' value='Reset'></center></p></td></tr>");
out.println("</form></table>");
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13077
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are getting a page not found error on submitting the form, then the problem is likely in the line:
"<form name='submit' action='http://192.168.180.2/servlet/students'
method='post' onsubmit='return validate()'>");
Are you sure that /servlet/students is the correct alias for the servlet you are calling?
To make debugging simple, you should make up a plain HTML page with this form. Use that to debug the form submission, then back to generating the form from a servlet.
Bill

------------------
author of:
 
mike sutton
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, I wasn't paying the attention. I recieved a "page cannot be displayed" error.
so I think it is in the page I am trying to call. Not in the code I showed above.
thanks
Mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic