On Mon, 22 Sep 2003 00:51, itsme reda wrote:

> but i ve a pb to run some servlets that i ve put in a
> test folder under webapps . every thing is correct
> because i got those servlet from a cd of a book. the
> pb that i get when i call this servlet from the
> browser- knowing that the url introduced is correct
> -is 404
> can anyone help me to resolve this pb

First of all putting some servlets in a folder under webapps won't nessasarily 
work. At the very least you need the following structure:

/WEB-INF directory
/WEB-INF/classes directory
/WEB-INF/web.xml file

The web.xml file can be very minimal, but is required in order for tomcat to 
recognise it as a web application. Also, how are you calling the servlet? If 
you want to call a servlet directly it usually looks somthing like:

http://localhost:8080/test/servlet/com.foo.MyTestServlet

However, if you want to have a more friendly URL you can create a mapping in 
the web.xml file like this:

        <servlet>
                <servlet-name>test</servlet-name>
                <servlet-class>com.foo.MyTestServlet</servlet-class>
        </servlet>

        <servlet-mapping>
                <servlet-name>test</servlet-name>
                <url-pattern>test</url-pattern>
        </servlet-mapping>

Regards,
Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to