• 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

parameter passing from form to servlet

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my servlet file is in
C:\tomcat4\webapps\examples\WEB-INF\classes\coreservlets\parameters.java
and html file is in
C:\tomcat4\webapps\forms\parametersform.html
Then i tried to access this form as follows
127.0.0.1:8080/forms/parametersform.html
it gives 404 error
Html file has action as follows:
<form action="/servlet/coreservlets.parameters">
plz help
 
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Dhanashree Mankar:
my servlet file is in
C:\tomcat4\webapps\examples\WEB-INF\classes\coreservlets\parameters.java


So your base dir is C:\tomcat4\webapps\examples\
And you need to have all your html files in here.
Copy your forms folder to C:\tomcat4\webapps\examples\
and then try http://127.0.0.1:8080/forms/parametersform.html
should work.
regards.
 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try this
127.0.0.1:8080/parametersform.html
and when calling servlet
127.0.0.1:8080/servlet/servletname
 
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

my servlet file is in
C:\tomcat4\webapps\examples\WEB-INF\classes\coreservlets\parameters.java
and html file is in
C:\tomcat4\webapps\forms\parametersform.html


1. parameters.java - you need to compile it to parameters.class
2. \forms\parameterform.html - If you do not have a forms\WEB-INF directory and a web.xml in that directory, Tomcat will NOT recognize forms as a valid web application and will not serve the html page.
3. use of /servlet/ in the action - IEEEEEE the invoker servlet problem strikes again. Read about it here in the excellent FAQ.
Bill
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic