aspose file tools*
The moose likes Tomcat and the fly likes Servlet question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Servlet question" Watch "Servlet question" New topic
Author

Servlet question

Ben Lim
Greenhorn

Joined: Apr 04, 2005
Posts: 9
hi i have install tomcat5.0.28, so now i want to put a new servlet code into the tomcat server, which folder should i put in?
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

I hope so, considering that this is a Servlets forum.

Sometimes a more descriptive topic name is better so that we can know what your question on Servlets is really about.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Well, now I read your question, and it isn't about a Servlet in particular, but a Tomcat question. So I will move this thread to the Apache/Tomcat forum.

Mark
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12671
    
    5
The regular installation of Tomcat includes documentation files that cover all questions like this. If you can see the regular Tomcat startup screen, you are in business.
Bill


Java Resources at www.wbrogden.com
Ben Weng
Greenhorn

Joined: Feb 22, 2005
Posts: 19
You don't drop it anywhere and hope it works. You'll have to package it someway and deploy it in tomcat, by deploying, the least thing to do is to let tomcat know you've come up with some servlets and the path to get to it.
As one option, Tomcat has a manager that lets you deploy your application which I found very useful during development.

Good luck.


-Ben<br />SCJP/SCJD 1.4<br />Certified Sybase DBA
Thana Bujakorn
Greenhorn

Joined: Jan 04, 2004
Posts: 11
Hi
I suggest you put it in Tomcat5/webapps/YourApp/WEB-INF ..., The book Head First Servlet & JSP is a pretty good one for whoever wants to learn servlet and JSP, It has the whole chapter on deploying webapps, I suggest you to buy it

Cheers


(scjp 1.4)
Satish SN
Ranch Hand

Joined: Apr 19, 2005
Posts: 70
Hi,

u compile the servlet file and put the Servlet1.class in /uapp/WEB-INF/classes folder

u need to modify the web.xml in the /WEB-INF folder by adding

<servlet>
<servlet-name>Servlet1</servlet-name>
<servlet-class>Servlet1</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Servlet1</servlet-name>
<url-pattern>/Servlet1</url-pattern>
</servlet-mapping>

resart the tomcat server this should solve ur problem


Satish SN<br />SCJP 1.4 & SCWCD 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet question
 
Similar Threads
servlet tag in JSPs
About some web descriptor dtd's
JDBC in Applets, problems
Servlet Error when deploy with tomcat
problem in execution