aspose file tools
The moose likes IDEs, Version Control and other tools and the fly likes Servlet 3.0 HTTP 404 - The requested resource () is not available Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Reply Bookmark "Servlet 3.0 HTTP 404 - The requested resource () is not available" Watch "Servlet 3.0 HTTP 404 - The requested resource () is not available" New topic
Author

Servlet 3.0 HTTP 404 - The requested resource () is not available

Joey Sanchez
Ranch Hand

Joined: Jun 23, 2011
Posts: 70

Environment:

Ubuntu 12.04
Apache Tomcat 7.0.27
Eclipse 4.2 (Juno)
Servlet 3.0
Openjdk 7
Trying to do a FileCounter with Servlet 3.0, I get this error on URL

http://localhost:8080/wtp.filecounter/.

Wouldn't have to be http://localhost:8080/wtp.filecounter/FileCounter?

Estado HTTP 404 -

type Informe de estado

mensaje

descripción El recurso requerido () no está disponible.

Apache Tomcat/7.0.2
6

Structure

wtp.filecounter
-dao
- -FileDao.java
-servlets
- -FileCounter.java

FileDao.java read and update visitors to a file



FileCounter.java servlet that read counter and write in text plain



web.xml


Any idea about what's wrong?

When I run on server the project open ''http://localhost:8080/wtp.filecounter/'' instead of ''http://localhost:8080/wtp.filecounter/FileCounter'' and the second URL works
K. Tsang
Ranch Hand

Joined: Sep 13, 2007
Posts: 1222

Joey Sanchez wrote:
When I run on server the project open ''http://localhost:8080/wtp.filecounter/'' instead of ''http://localhost:8080/wtp.filecounter/FileCounter'' and the second URL works


Hi Joey

The second one works because that where the servlet is found. The "wtp.filecounter" portion is your application context. If you want to access the servlet using "http://localhost:8080/wtp.filecounter/" then you need to change your welcome file to point to the FileCounter servlet instead of using those default welcome files.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Servlet 3.0 HTTP 404 - The requested resource () is not available
 
Similar Threads
Running a servlet on Tomcat using Eclipse
Problem calling a servlet from JSP
HTTP Status 404 using Servlet 3.0
error for first web application : The requested resource (/Beer-v1/SelectBeer.do) is not available.
unbale to view xml file in browser