url pattern for html file in web.xml

Selva picture Selva · Apr 20, 2015 · Viewed 11.5k times · Source

we know how to set url pattern for servlet but I am unable to set url pattern for html in web.xml, can u help me to find solution, I googled but, can't able to get it, please find below for my problem.

<servlet>
    <servlet-name>Login</servlet-name>
    <servlet-class>auth.Login</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>Login</servlet-name>
    <url-pattern>/login</url-pattern>
</servlet-mapping>

in above code I am setting url pattern for **Login** servlet class in web.xml, like wise can I able to set url pattern for html file in web.xml pls help to find solution thank you in advance

Answer

Jafar Ali picture Jafar Ali · Apr 20, 2015

URL pattern are for servlet and filters. For servlet

<servlet-mapping>
    <servlet-name>Servlet-name</servlet-name>
    <url-pattern>/< Pattern ></url-pattern>
</servlet-mapping>

For Filter

<filter-mapping>
    <filter-name>Filter-Name</filter-name>
    <url-pattern>/< Pattern ></url-pattern>
    <dispatcher>REQUEST</dispatcher>
</filter-mapping>

Those are not for Html file. Infact there are no pattern configuration for JSPs too.