views:

367

answers:

1

I am in the process of writing a Java web app and am having issues getting my servlet to work properly.

This is from my web.xml file:

  <servlet>
    <description>Called to process any forms on the website</description>
    <display-name>Form Processing Servlet</display-name>
    <servlet-name>FormAction</servlet-name>
    <servlet-class>com.devwork.servlets.FormAction</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>FormAction</servlet-name>
    <url-pattern>/servlet/FormAction</url-pattern>
  </servlet-mapping>
</web-app>

yet when I deploy the application to Glassfish 3 it returns a 404 when sending data from a form via HTTP POST to the correct servlet URL. The address bar has the correct URL for servlet and the servlet is shown in the Glassfish 3 admin panel as being installed along with the other servlets and stuff included in the WAR file.

My sun-web.xml file is the standard one that Eclipse 3.5.1 generates so that should not be an issue. Can anyone point me in the right direction with this problem? The server log file states that the WAR was successfully deployed.

Thanks.

+4  A: 

Two possibilities come to mind:

Drew Wills
Gah, thank you. It was number two. I have absolutely no idea how I missed that but there you go. Your help was much appreciated.
Simon
Third cause, a bit simliar to your second cause, is that the URL is plain wrong. Most starters overlook the case sensitivity of it. If it was invoked as `servlet/formaction`, then it would have returned 404 either.
BalusC