Ying,
To execute a servlet under tomcat without changing your deployment
descriptor file (web.xml) you need to put the name "servlet" in your URL.
For example, lets say that you create a directory called "tom" (That's a
real good name) under the "webapps" directory. The "tom" directory is where
you (can) put your jsp's and html pages. below that directory you make a
directory called "WEB-INF" (it is case sensitive. There you put your web.xml
file (if you have one). Under the "WEB-INF" directory you make a "classes"
directory. That is where you put your servlets. Now to access your jsp's and
html pages your URL would be http://localhost/tom/someJSP.jsp but for your
servlet your URL would be http://localhost/tom/servlet/MYservlet I suggest
that you take the time to look at how the structure of tomcat is set up. It
is very much worth your time to do so, since tomcat is the standard model
for most containers.
Hope this help,
Tom K.
-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of Ying
Su
Sent: Wednesday, March 13, 2002 1:53 AM
To: [EMAIL PROTECTED]
Subject: Problems in configuring Tomcat
Dear all,
I have set up Tomcat and seen the welcome page successfully. But I can't run
servlet. For example, I wrote a simple servlet "HelloWorld.java" which
prints "hello world" in brower, then put the "HelloWorld.class" file in
Tomcat's "examples" directory. But when I visit it by
http://localhost/examples/HelloWorld, Tomcat gives me an error message "The
requested resource (/HelloWorld) is not available." However, jsp files could
be executed properly. Does anyone know how to run my servlet?
Thanks a lot!
Sincerely
Ying
N�����r��zǧu� [h�+-��ڲ�ܢf�v)ܖ�^ {ay� ʇ�鞲� z� ���HDU,D�51 $���b�
�!�� ��܆+6�j˧r��j�! ���ǫ�W� {^��-�٥E�(�� � m���j���w(��k�ۜ���z��z����
���kz�.�Ǭ�٥,��HDU �i��i��0�[(~�(����楳��z����
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html