| Author |
The requested resource (/Person/) is not available.
|
Omar Perez
Ranch Hand
Joined: Jul 08, 2011
Posts: 35
|
|
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
|
 |
Koen Aerts
Ranch Hand
Joined: Feb 07, 2012
Posts: 344
|
|
|
You servlet class (web.xml) should be "servlet.WebServlet" not "WebServlet". You have to specify the whole class name, that includes the package.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56229
|
|
|
And, you went through all the trouble to create servlet mapping for the servlet. Why aren't you using it?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Omar Perez
Ranch Hand
Joined: Jul 08, 2011
Posts: 35
|
|
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.
|
 |
Omar Perez
Ranch Hand
Joined: Jul 08, 2011
Posts: 35
|
|
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.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19216
|
|
|
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?
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Omar Perez
Ranch Hand
Joined: Jul 08, 2011
Posts: 35
|
|
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".
|
 |
Piyush Mangal
Ranch Hand
Joined: Jan 22, 2007
Posts: 196
|
|
|
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.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56229
|
|
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.
|
 |
 |
|
|
subject: The requested resource (/Person/) is not available.
|
|
|