I am using Tomcat 4.1
I have created a folder named test in the ROOT.
This test folder contains JSP.
I want to be able 2 call servlets from this JSP but cannot figure out where 2 place the servlet class.
Any suggessions ?
Plz help.
-
URGENT : Where shud the classes go ? (1 messages)
- Posted by: Sherbir Singh
- Posted on: June 24 2004 02:08 EDT
Threaded Messages (1)
- URGENT : Where shud the classes go ? by Amit L on June 24 2004 04:31 EDT
-
URGENT : Where shud the classes go ?[ Go to top ]
- Posted by: Amit L
- Posted on: June 24 2004 04:31 EDT
- in response to Sherbir Singh
I am using Tomcat 4.1I have created a folder named test in the ROOT.This test folder contains JSP.I want to be able 2 call servlets from this JSP but cannot figure out where 2 place the servlet class.Any suggessions ? Plz help.
Hi,
You need to keep your servlet in WEB-INF\classes directory,if you are putting them as classes. If you are collecting all your servlets in a Jar then put them in WEB-INF\lib directory.
Suppose you have a servlet com.amit.HelloWorldServlet then since this servlet is in a package you will need to create directory structure like below.
WEB-INF\classes\com\amit\ and then put the servlet class file over here.
Remember to be able to call the servlet from the JSP or directly from the browser you will also need to register the servlet in Tomcat using web.xml in WEB-INF directory.
Hope this helps
Amit