• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet question

 
Ben Lim
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ben Weng
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Thana Bujakorn
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Satish SN
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic