Greetings to all.
I am new to JSP and Tomcat - but trying diligently to learn quickly.
I have what are most probably basic questions. I am using the latest, so I assume, Tomcat 4.1.12. I am attempting to create a Webapp and Servlet.
I get the Tomcat 404 error, "The Requested resource is not available."
I suspect I have two problems(more details follow basic descriptions):
1. My servlet isn't recognized once compiled from .java to .class using latest java 1.4.1_01 javac command.
2. I think my webapp is not recognized.
DETAILS
What I tried: after inital failure, I attempted copying my .class file to the example directory and executing with localhost:8080/examples/servlet/MyServlet just as the HellowWorld servlet is called in an attempt to eliminate possible causes. No luck with this. (I had restarted Tomcat after pasting .class file.)
I also tried copying and pasting the HelloWorldExample .class file to my webapp directory and it would not execute.
My webapp Directory (courtesy of WROX Professional JSP [which has not a few typo's]:
%TOMCAT%\ch03\WEB-INF\classes\com\wrox\projsp\ch03\app1\
and the URL that should activate it:
localhost:8080/ch03/servlet/com.wrox.projsp.ch03.app1.MyFirstServlet
I changed the laboriously long .myfirstwebapp. to .app1. both in the package declaration of my .class as well as the call the attempted activation URL.
If this is the wrong place to ask for help with basics such as this, plese forgive me - I am hoping this is the place and am all too happy to go where directed for answers.
If this is the right place, all help is appreciated.
Kind regards,
Jered
p.s. java follows
package com.wrox.projsp.ch03.app1;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpRequest;
import javax.servlet.http.HttpResponse;
import javax.servlet.ServletException;
public class MyFirstServlet extends Httpservlet {
public void doGet (HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException {
response.setConentType("text/plain");
PrinWriter out = response.getWriter();
out.println("Frustration: bane of inspiration");
}
}
-=| Just say NO to post-modernism. |=-
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
Hello Jered, this is the right place. code is not ur problem. on the surface (because servlet code is all u sent) i suspect u have not defined ur servlet in web.xml. this aside, if u r really interested in learning use the tools provided by tc: ant build. also, don't do too much: this means don't develop a "Hello World" servlet and jsp. allow me to suggest to develop only a servlet at first, then progress to jsp's and other objects later. look closely at the http://localhost:8080/examples and the other demos supplied w/ tc. learne to build and deploy a "Hello World" using ant and preferably if u can congifure apache w/ tc. tc by itself is not very usefull unless u r inside a protected environment (no internet connection or very heavy firewall and CA encrpted ssl stuff). hope this helps, david.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
