Jon Bexiga wrote:I am having the same problem. I successfully compiled my Ch1Servlet.java file so it is now a .class file in my tomcat/webapps/ch1/WEB_INF/classes directory. I also included this in my web.xml file which is located in my /WEB-INF directory:
<?xml version="1.0" encoding="ISO-8851-1" ?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<servlet>
<servlet-name>Chapter1 Servlet</servlet-name>
<servlet-class>Ch1Servlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Chapter1 Servlet</servlet-name>
<url-pattern>/Serv1</url-pattern>
</servlet-mapping>
</web-app>
When I try to access the servlet at http://localhost:8080/ch1/Serv1, I am still receiving the "error 404", "The requested resource () is not available.", "type status report". Can anyone assist?
Christian Cabizza
Junior Java Developer at Nexus S.r.l.
Jon Bexiga wrote:I am having the same problem. I successfully compiled my Ch1Servlet.java file so it is now a .class file in my tomcat/webapps/ch1/WEB_INF/classes directory. I also included this in my web.xml file which is located in my /WEB-INF directory:
<?xml version="1.0" encoding="ISO-8851-1" ?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
<servlet>
<servlet-name>Chapter1 Servlet</servlet-name>
<servlet-class>Ch1Servlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Chapter1 Servlet</servlet-name>
<url-pattern>/Serv1</url-pattern>
</servlet-mapping>
</web-app>
When I try to access the servlet at http://localhost:8080/ch1/Serv1, I am still receiving the "error 404", "The requested resource () is not available.", "type status report". Can anyone assist?
Christian Cabizza
Junior Java Developer at Nexus S.r.l.
Cheers,
Roy.
Sun Certified Java Programmer 1.5,
Sun Certified Web Component Developer 5.
"No pain. No Gain"
http://cs.nyu.edu/~rpm319
Author of ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- OCPJP Online Training -- Twitter -- How to Ask a Question
Bear Bibeault wrote:Please read: UseCodeTags
And put your servlet in a package other than the default. This is a recording.
Author of ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- OCPJP Online Training -- Twitter -- How to Ask a Question
Mindless Abomination wrote:sorry Bear, I didn't quite understand what you meant. Could you be a little more specific?
Author of ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- OCPJP Online Training -- Twitter -- How to Ask a Question
Devaka Cooray wrote:
Mindless Abomination wrote:sorry Bear, I didn't quite understand what you meant. Could you be a little more specific?
It's about your servlet class. You should package it using a proper package definition.
Then use the fully-qualified class name for the <servlet-class> element.
Mindless Abomination wrote:I'll change my name if you insist
Author of ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- OCPJP Online Training -- Twitter -- How to Ask a Question
SCJP6.0,My blog Ranchers from Delhi
Divya
SCJP1.6
SCJP 6 83%
Working on SCWCD/OCPJWCD
Often the most important part of the news is what they didn't tell.
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|