tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris <bg...@lafn.org>
Subject problem with tomcat servlet
Date Sat, 09 Aug 2003 22:12:53 GMT
I typed in a simple servlet example from the book "Tomcat Kick Start" 
(Sams).  Basically I put the html and servlet class as follow:

$CATALINA/webapps/mybasic_servlet/CurrencyForm.html
$CATALINA/webapps/mybasic_servlet/WEB-INF/classes/CurrencyConverter.class

When I start Tomcat, and access: 
http://localhost:8080/mybasic_servlet/CurrencyForm.html and type a 
number in the text input and submit, the browser returns a 404 error

The requested resource (/mybasic_servlet/servlet/CurrencyConverter) is 
not available.

If I add a web.xml file to $CATALINA/webapps/mybasic_servlet/WEB-INF/, 
and the web.xml uses
   <servlet-mapping>
        <servlet-name>Currency Converter</servlet-name>
        <url-pattern>/convert</url-pattern>
    </servlet-mapping>

and changes my html to  <FORM METHOD=GET ACTION="convert">
Now after restarting Tomcat, and access: 
http://localhost:8080/mybasic_servlet/CurrencyForm.html and type a 
number in the text input an submit, this time the servlet gets triggered.


I have enclosed the files and would really apprceciate if someone 
explain this 404 error to me.

Thanks in advance.

-chris




Mime
View raw message