I have this form declaration in my JSP page:
<form name="login" method="post" action="loginServlet">
Assume that the servlet is appropriately declared in the web.xml file; with this pattern <url-pattern>/loginServlet</url-pattern>
;
this servlet
contains a doPost method.
But what happens is that when I press the button associated to the login form, the server complains that this servlet is not found. What kind of path should I use in order to make it work?
This is the folder structure of my project:
-Project0
-jsppages
login.jsp
+htmlpages
-WEB-INF
-classes
LogIn.class
I guess there's a problem with the path. How could I fix this. Thank you!
Edit: the web.xml contains exactly this referred to my servlet:
<servlet>
<servlet-name>LogInServlet</servlet-name>
<servlet-class>LogIn.class</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LogInServlet</servlet-name>
<url-pattern>/loginServlet</url-pattern>
</servlet-mapping>
SOLVED:
When calling the action releted to the form, it was necessary to go out of the JSP folder in my project folder by using the path ../loginsServlet so it becomes like this.
<form name="login" method="post" action="../loginServlet">