new to servlet. File Not found exception.

I have a jsp page from which I want to invoke a servlet. I am using the following code

<form action="/servlet/empServlet" method="post">

I have the configured servlet in web.xml file as give below.

<servlet>

<servlet-name>empServlet</servlet-name>

<servlet-class>com.pd.employees.EmpServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>empServlet</servlet-name>

<url-pattern>/servlet/*</url-pattern>

</servlet-mapping>

When I submit the jsp page, I get "HTTP 404 - File not found" error. Why am I getting this error.

I am using Oracle JDeveloper.

rgds,

Jatin

[829 byte] By [Jatin_Kulkarnia] at [2007-11-27 6:03:11]
# 1
Replace the action by action="/servlet".
BalusCa at 2007-7-12 16:45:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
I used the action tag as suggested by you but I still get the same error.
Jatin_Kulkarnia at 2007-7-12 16:45:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
What is the current context root? Maybe you just need to remove the leading slash.
BalusCa at 2007-7-12 16:45:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Yes removing slash works although I don't have much idea about the root context. Thanks very much
Jatin_Kulkarnia at 2007-7-12 16:45:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5

If there is a leading slash in the relative path, then it will bring you to the root.

E.g., if you are in "http://example.com/webapp/page.jsp" and you point the relative path to "/servlet" then it will bring you to "http://example.com/servlet" which apparently doesn't exist. If there is no leading slash, then you will stay in the current context, so the relative path "servlet" will bring you to "http://example.com/webapp/servlet".

BalusCa at 2007-7-12 16:45:38 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...