Problem in calling a servlet from JSP

Hi,

I am trying to call Loginservlet from my UserLogin.jsp and the code I used in jsp is:

<form method="post" action="/LoginServlet name=form1>

All the components are here

</form>

And I have also checked web.xml. It looks like

<servlet>

<servlet-name>LoginServlet</servlet-name>

<servlet-class>servlets.LoginServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>LoginServletServlet</servlet-name>

<url-pattern>/LoginServlet</url-pattern>

</servlet-mapping>

But still when I submit the Jsp page, I am getting error which says the resource "servlets.LoginServlet" is not available.

I am using TOMCAT5.0 server and eclipse IDE.>

[828 byte] By [desh.ka] at [2007-11-27 0:48:11]
# 1

change

<servlet>

<servlet-name>LoginServlet</servlet-name>

<servlet-class>servlets.LoginServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>LoginServletServlet</servlet-name>

<url-pattern>/LoginServlet</url-pattern>

</servlet-mapping>

to

<servlet>

<servlet-name>LoginServlet</servlet-name>

<servlet-class>servlets.LoginServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>LoginServlet</servlet-name>

<url-pattern>/LoginServlet</url-pattern>

</servlet-mapping>

and check wid

<form method="post" action="LoginServlet" name=form1>

& make sure you have placed LoginServlet.class in <WEB_APP>/WEB-INF/classes/servlet/ folder

Hope this might help :)

REGARDS,

RaHuL

RahulSharnaa at 2007-7-11 23:17:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
<servlet><servlet-name>LoginServlet</servlet-name></servlet><servlet-mapping><servlet-name>LoginServletServlet</servlet-name></servlet>The servlet-name have to be the same.
BalusCa at 2007-7-11 23:17:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3

I am sorry for mistyping that, my web.xml contains the code below exactly

<servlet>

<servlet-name>LoginServlet</servlet-name>

<servlet-class>servlets.LoginServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>LoginServlet</servlet-name>

<url-pattern>/LoginServlet</url-pattern>

</servlet-mapping>

desh.ka at 2007-7-11 23:17:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
Please can any one help, I had completed all the servlets and helper classes, But got stuck here with my application not finding requested servlets.desh.k
desh.ka at 2007-7-11 23:17:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
<form method="post" action="LoginServlet" name=form1>..............................................................................</form>call the servlet in the following fashion tht has to help U...
RahulSharnaa at 2007-7-11 23:17:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6
post the package statement for LoginServletpost the file hierarchy of your application
rym82a at 2007-7-11 23:17:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7

Thankyou for the response.

I am sorry for mistyping the servlet name in the post. Actually my web.xml contains the following lines:

<servlet>

<servlet-name>LoginServlet</servlet-name>

<servlet-class>servlets.LoginServlet</servlet-class>

</servlet>

<servlet-mapping>

<servlet-name>LoginServlet</servlet-name>

<url-pattern>/LoginServlet</url-pattern>

</servlet-mapping>

desh.ka at 2007-7-11 23:17:03 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...