Forums Register Login

The requested resource (/Person/) is not available.

+Pie Number of slices to send: Send
Greetings,

Well I'm stuck in a example of the book Head First Servler and JSP, however I don't see why the code is not working as it should. It should display "Person is : Evans"

The Javabean


The Servlet



DD
+Pie Number of slices to send: Send
You servlet class (web.xml) should be "servlet.WebServlet" not "WebServlet". You have to specify the whole class name, that includes the package.
+Pie Number of slices to send: Send
And, you went through all the trouble to create servlet mapping for the servlet. Why aren't you using it?
+Pie Number of slices to send: Send
 

Koen Aerts wrote:You servlet class (web.xml) should be "servlet.WebServlet" not "WebServlet". You have to specify the whole class name, that includes the package.



I get the same error, with or without the full qualified name.
+Pie Number of slices to send: Send
 

Bear Bibeault wrote:And, you went through all the trouble to create servlet mapping for the servlet. Why aren't you using it?



It just doesn't work at all, I get the same error.
+Pie Number of slices to send: Send
You're trying to access /Person/ but you only have a servlet mapping for /servlet.do. I'm also not seeing any filters or other servlet mappings, so what makes you think there even is a /Person/ resource?
+Pie Number of slices to send: Send
 

Rob Spoor wrote:You're trying to access /Person/ but you only have a servlet mapping for /servlet.do. I'm also not seeing any filters or other servlet mappings, so what makes you think there even is a /Person/ resource?



Servlet.do is a logical name, nothing else. I'm using eclipse and the name of the project is eclipse, so it should upload the app as the project's name "Person".
+Pie Number of slices to send: Send
Person would be your web application context name and as you do not have any index.html or index.jsp etc, you need to provide the logical name as well in your url. It should be something like http://localhost:8080/Person/servlet.do assuming your web server is running on 8080 on your local machine.
+Pie Number of slices to send: Send
 

Omar Perez wrote:

Rob Spoor wrote:You're trying to access /Person/ but you only have a servlet mapping for /servlet.do. I'm also not seeing any filters or other servlet mappings, so what makes you think there even is a /Person/ resource?



Servlet.do is a logical name, nothing else. I'm using eclipse and the name of the project is eclipse, so it should upload the app as the project's name "Person".


That makes no sense at all. If the name of the project is "eclipse" what does that have to do with "Person"? And once again, you access servlets through the servlet mappings.
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3056 times.
Similar Threads
1st servlet example
Jsps and Servlets
WebLogic12C + Eclipse Indigo develop JSF 2.0 with CDI
Newbie problem from chapter1 of Head First Servlets & JSP
error for first web application : The requested resource (/Beer-v1/SelectBeer.do) is not available.
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 06:46:28.