This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Http 404 Error with servlet deployment.  might be simple, but its irking Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Http 404 Error with servlet deployment.  might be simple, but its irking " Watch "Http 404 Error with servlet deployment.  might be simple, but its irking " New topic
Author

Http 404 Error with servlet deployment. might be simple, but its irking

Kary Red
Greenhorn

Joined: Dec 21, 2012
Posts: 1
folder structure for my web-app is
teams/
JSP
Resources
WEB-INf
WEB-INf/classes/com/test/WatermarkImageServlet.class



I am calling the servlet from a jsp page using
<%
String destination ="/teams/WatermarkImageServlet";
response.sendRedirect(response.encodeRedirectURL(destination));
%>



This is my web.xml configuration
<servlet>
<servlet-name>WatermarkImageServlet</servlet-name>
<servlet-class>com.test.WatermarkImageServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>WatermarkImageServlet</servlet-name>
<url-pattern>/WatermarkImageServlet</url-pattern>
</servlet-mapping>


I dont understand why I am getting this
HTTP Status 404 error - Servlet WatermarkImageServlet is not available
Harry Jones
Greenhorn

Joined: Mar 19, 2010
Posts: 20
Try replacing /teams in destination with /com/test
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

An easier test would be to try to access your servlet directly from the browser. The URL should be something like this:

http://yourserver:port/teams/WatermarkImageServlet

And by the way that folder shouldn't be called "WEB-INf", it should be called "WEB-INF" as per the specifications. Even if you're using a file system which isn't case-sensitive, it's always a good idea to follow the spec.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60822
    
  65

Have you worked through the suggestions in the ServletsFaq?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Http 404 Error with servlet deployment. might be simple, but its irking
 
Similar Threads
Unable to view application
Tomcat (Tomcat Manager) Authentication with AD ----problem
Confusion regarding ViewResolvers in Sppring framework
beer app not running
Servlet 404 error