• 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

loading one servlet from another servlet

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>");
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic