tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arion Yu <ario...@stt.com.hk>
Subject Re: How to run servlets???
Date Thu, 28 Sep 2000 06:14:35 GMT
Hi!

It should be WEB-INF instead of WEB_INF

Arion

Partha Bhattacharjee wrote:

> Hello,
>
> I have just installed tomcat in my computer. I have been able to run jsp
> pages but  not servlets. Here are the steps that I followed to run servlets.
>
> Created a dir 'myjsp' in 'webapps' directory.
>
> Written the following xml element in the 'server.xml'
>
> <Context
>         path="/myjsp"
>         docBase="webapps/myjsp"
>         debug="0"
>         reloadable="true">
> </Context>
> Created a 'WEB_INF' dir in 'myjsp'.
> Created a 'classes' dir in 'WEB_INF'.
>
> In 'WEB_INF' I placed the following 'web.xml' file.
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <!DOCTYPE web-app
>     PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
>     "http://java.sun.com/j2ee/dtds/web-app_2.2.dtd">
>
> <web-app>
>     <servlet>
>         <servlet-name>
>             firstServlet
>         </servlet-name>
>         <servlet-class>
>             firstServlet
>         </servlet-class>
>     </servlet>
>
>     <servlet-mapping>
>         <servlet-name>
>             firstServlet
>         </servlet-name>
>         <url-pattern>
>             /firstServlet
>         </url-pattern>
>     </servlet-mapping>
>
> </web-app>
>
> Now I have put 'firstServlet.class' in the 'classes' directory.
>
> Still I can not get the servlets on the web browser. However the .jsp files
> put in the  'myjsp' are working fine.
>
> Please help.
> Thanks in advance.
> partha.

--
[This email and any files transmitted with it are confidential and may contain
information that is legally privileged. They are intended solely for the
addressee(s). Access to this email by anyone else is unauthorized. If you are
not the intended recipient, please delete it and notify the sender by email
immediately; you should not copy or use it for any purpose, nor disclose its
contents to any other person. Thank you.]



Mime
View raw message