Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

First time using Tomcat

 
Mathias Nilsson
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I am trying to develop a webapplication with jsp , tomcat.
I can access my jsp files , html files using the
localhost:8080/myproject/test.jsp and so on. I can access a bean from my project but I can't access my servlet. What am I doing wrong?
I compiled the servlet in the d:\tomcat4.0\webapps\myproject\web-inf\classes\ dir.
When I try to access it I use
localhost:8080/myproject/servlet/Hello
I can't get it to work.
Does somebody know what I'm doing wrong
// Mathias Nilsson
 
Mathias Nilsson
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I got it now. I had to stop tomcat, delete all files in the work cataloge and then try again an it worked.
// Mathias
 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Mathias, glad you got your problem solved. On a good day all the problems seem solvable - got another little one for you, and it's real easy to fix (this must be a good day already)
Your display name doesn't quite fit the famous JavaRanch naming policy. Could you please take a minute to change your display name to show 2 names, preferably your real name. (It's all about maintaining our professional image - don't let the one-eyed moose fool you!).
Welcome to JavaRanch and hope you'll be visiting often,
Pauline
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two things:
1. Using the ../servlet/myServlet url approach to fire the "invoker" servlet will cause you nothing but trouble as seen in MANY MANY postings here recently. Much better to correctly map your servlet directly to a URL in web.xml.
2. Tomcat has a lovely management servlet that will allow you to restart and otherwise control an application without stopping and starting Tomcat.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic