Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try replacing /teams in destination with /com/test
 
Sheriff
Posts: 23873
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Marshal
Posts: 67164
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you worked through the suggestions in the ServletsFaq?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!