This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Servlets and the fly likes parameter passing from form to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "parameter passing from form to servlet" Watch "parameter passing from form to servlet" New topic
Author

parameter passing from form to servlet

Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
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

Joined: May 10, 2001
Posts: 309
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

Joined: Nov 20, 2003
Posts: 33
try this
127.0.0.1:8080/parametersform.html
and when calling servlet
127.0.0.1:8080/servlet/servletname


if u can't impress people with ur intelligence , confuse them with ur bullshit
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12792
    
    5
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
 
 
subject: parameter passing from form to servlet