web.xml : URL mapping
- by Devashish Dixit
I have these two lines in my web.xml
<url-pattern>/</url-pattern> : Index Servletand
<url-pattern>/login</url-pattern> : Login Servlet
but whem I open http://localhost:8084/login/, it goes to Index Servlet and when I open http://localhost:8084/login, it goes to Login Servlet.
Is there any difference in http://localhost:8084/login/ and http://localhost:8084/login?
My web.xml
<servlet>
<servlet-name>Index</servlet-name>
<servlet-class>Index</servlet-class>
</servlet>
<servlet>
<servlet-name>Login</servlet-name>
<servlet-class>Login</servlet-class>
</servlet>
and
<servlet-mapping>
<servlet-name>Index</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Login</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>