You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jacob Kjome <ho...@visi.com> on 2002/09/12 22:59:15 UTC
Re[2]: Help Deploying Servlet
Hello Chuck,
You need to specify a <servlet-class>, not a <url-pattern> in your
<servlet> declaration.
For instance:
<servlet>
<servlet-name>hi</servlet-name>
<servlet-class>mypackage.Hello</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hi</servlet-name>
<url-pattern>/hello.html</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>hi</servlet-name>
<url-pattern>*.hello</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>hi</servlet-name>
<url-pattern>/hello/*</url-pattern>
</servlet-mapping>
Notice all the different mappings we can make for the same servlet.
in addition to all those mappings you can access your servlet via
Tomcat's default invoker servlet via:
http://localhost:8080/servlet/hi
or
http://localhost:8080/servlet/mypackage.Hello
That's more than you asked for, but I just figured I'd add it :-)
Jake
Thursday, September 12, 2002, 3:31:44 PM, you wrote:
>> -----Original Message-----
>> From: Vincent.Gaboriau@answare.fr
>> [mailto:Vincent.Gaboriau@answare.fr]
>> Sent: Thursday, September 12, 2002 9:45 AM
>> To: Tomcat Users List
>> Subject: RE: Help Deploying Servlet
>>
>>
>> Have you specify the "servlet-mapping".
>>
>> for exemple :
>>
>> <servlet-mapping>
>> <servlet-name>AddNewsItem</servlet-name>
>> <url-pattern>/AddNewsItem</url-pattern>
>> </servlet-mapping>
CC> No, I only had this:
CC> <web-app>
CC> <servlet>
CC> <servlet-name>AddNewsItem</servlet-name>
CC> <url-pattern>/AddNewsItem</url-pattern>
CC> </servlet>
CC> </web-app>
CC> So is this what I need?
CC> <web-app>
CC> <servlet>
CC> <servlet-mapping>
CC> <servlet-name>AddNewsItem</servlet-name>
CC> <url-pattern>/AddNewsItem</url-pattern>
CC> </servlet-mapping>
CC> </servlet>
CC> </web-app>
CC> Thanks,
CC> Chuck
>>
>>
>> -----Message d'origine-----
>> De : Chuck Carson [mailto:Chuck.Carson@syrrx.com]
>> Envoye : jeudi 12 septembre 2002 18:27
>> A : Tomcat Users List
>> Objet : Help Deploying Servlet
>>
>>
>>
>> I have the following servlet:
>> $TOMCAT_HOME/webapps/ROOT/WEB-INF/classes/AddNewsItem.class
>>
>> I addded this to WEB-INF/web.xml
>> <web-app>
>> <servlet>
>> <servlet-name>AddNewsItem</servlet-name>
>> <servlet-class>AddNewsItem</servlet-class>
>> </servlet>
>> </web-app>
>>
>> I restarted tomcat but I keep getting 404's when referring to
>> AddNewsItem from a jsp page like so:
>>
>> <FORM action="AddNewsItem" method="POST">
>>
>> What am I missing?
>>
>> Thanks,
>> Chuck
>>
>>
>>
>> Chuck Carson
>> Sr. Systems Administrator
>> Syrrx, Inc.
>> 10410 Science Center Drive
>> San Diego, CA 92121
>> E: ccarson@syrrx.com <ma...@syrrx.com>
>> W: 858.731.3540
>> M: 858.442.0827
>>
>>
>> ----------
>> This message contains confidential information and is
>> intended only for the individual named. If you are not the
>> named addressee you should not disseminate, distribute or
>> copy this e-mail. Please notify the sender immediately by
>> e-mail if you have received this e-mail by mistake and delete
>> this e-mail from your system. E-mail transmission cannot be
>> guaranteed to be secure or error-free as information could be
>> intercepted, corrupted, lost, destroyed, arrive late or
>> incomplete, or contain viruses. The sender therefore does not
>> accept liability for any errors or omissions in the contents
>> of this message, which arise as a result of e-mail
>> transmission. If verification is required please request a
>> hard-copy version.
>>
>>
>> --
>> To unsubscribe, e-mail:
>> <mailto:tomcat-user-> unsubscribe@jakarta.apache.org>
>> For
>> additional commands,
>> e-mail: <ma...@jakarta.apache.org>
>>
>>
CC> ----------
CC> This message contains confidential information and is intended only for
CC> the individual named. If you are not the named addressee you should not
CC> disseminate, distribute or copy this e-mail. Please notify the sender
CC> immediately by e-mail if you have received this e-mail by mistake and
CC> delete this e-mail from your system. E-mail transmission cannot be
CC> guaranteed to be secure or error-free as information could be
CC> intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
CC> contain viruses. The sender therefore does not accept liability for any
CC> errors or omissions in the contents of this message, which arise as a
CC> result of e-mail transmission. If verification is required please
CC> request a hard-copy version.
CC> --
CC> To unsubscribe, e-mail: <ma...@jakarta.apache.org>
CC> For additional commands, e-mail: <ma...@jakarta.apache.org>
--
Best regards,
Jacob mailto:hoju@visi.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>