web.xml : URL mapping
Posted
by
Devashish Dixit
on Stack Overflow
See other posts from Stack Overflow
or by Devashish Dixit
Published on 2012-06-17T12:01:10Z
Indexed on
2012/06/17
15:16 UTC
Read the original article
Hit count: 289
I have these two lines in my web.xml
<url-pattern>/</url-pattern> : Index Servlet
and
<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>
© Stack Overflow or respective owner