unable to run servlet in Apache Tomcat/5.5.17

C

crazzybugger

hi i have a situation where i am not able to run any servlets on
tomcat................. first there is no "classes" folder within the
/webapps/ROOT/ folder............
so i created one......and added the class files...........however when
i try http://localhost:8080/servlet/servletName i am getting an error
sayin resource not found............i find it very annoying and i tried
moving the class files in and out of the folders but no magic
happens.............
help me :(
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

crazzybugger said:
hi i have a situation where i am not able to run any servlets on
tomcat................. first there is no "classes" folder within the
/webapps/ROOT/ folder............
so i created one......and added the class files...........however when
i try http://localhost:8080/servlet/servletName i am getting an error
sayin resource not found............i find it very annoying and i tried
moving the class files in and out of the folders but no magic
happens.............

Have you configured the servlet in web.xml ?

Arne
 
C

crazzybugger

Arne said:
Have you configured the servlet in web.xml ?

Arne

no i have not configured my server............if you mean to say i have
put that "servlet-mapping" tag into the web.xml , i dont think so i can
do it for each and every servlet that i am going to test and run
 
J

jagonzal

crazzybugger said:
hi i have a situation where i am not able to run any servlets on
tomcat................. first there is no "classes" folder within the
/webapps/ROOT/ folder............
so i created one......and added the class files...........however when
i try http://localhost:8080/servlet/servletName i am getting an error
sayin resource not found............i find it very annoying and i tried
moving the class files in and out of the folders but no magic
happens.............
help me :(

Your class should be within "ROOT/WEB-INF/classes"

And you have to add your servlet (with <servlet> and <servlet-mapping>
tags) in your web.xml
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

crazzybugger said:
no i have not configured my server............if you mean to say i have
put that "servlet-mapping" tag into the web.xml , i dont think so i can
do it for each and every servlet that i am going to test and run

You need to either put each servlet in web.xml or use
the invoker servlet.

And I will not recommend the last solution.

Arne
 
M

Mark Space

Your class should be within "ROOT/WEB-INF/classes"

And you have to add your servlet (with <servlet> and <servlet-mapping>
tags) in your web.xml

Also, one does not normally use the ROOT application. One deploys
separate apps parallel to ROOT, directly under /webapps/ folder. Most
practical guides I've seen say to delete the ROOT folder so it can't be
used as an exploit.

Unless I misunderstand completely what you are trying to do...
 
C

crazzybugger

Mark said:
Also, one does not normally use the ROOT application. One deploys
separate apps parallel to ROOT, directly under /webapps/ folder. Most
practical guides I've seen say to delete the ROOT folder so it can't be
used as an exploit.

Unless I misunderstand completely what you are trying to do...


i am quite new to web applications and this is my first try with
servlets....... basically i need the servlets for uploading data as
well as registering new users........along with some authentication
routines
 
W

William Brogden

That URL is using the "invoker servlet" syntax - the cause of much beginner
grief. Invoker used to be turned on in early Tomcat distributions and thus
this syntax appears in early books. See this Javaranch FAQ discussion:

http://faq.javaranch.com/view?InvokerServlet
Also, one does not normally use the ROOT application. One deploys
separate apps parallel to ROOT, directly under /webapps/ folder. Most
practical guides I've seen say to delete the ROOT folder so it can't be
used as an exploit.

Unless I misunderstand completely what you are trying to do...


ROOT is simply Tomcat's convention for the "/" location - there is utterly
no reason to delete it, just substitute your own web application.


Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top