This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

parameter passing from form to servlet

 
Dhanashree Mankar
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • 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
 
shankar vembu
Ranch Hand
Posts: 309
  • Mark post as helpful
  • send pies
  • 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.
 
Sim Raina
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • 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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic