For example - When a user types www.example.com , I want the application to direct to abc.jsp page
Configure it as a <welcome-file>
in the web.xml
like follows:
<welcome-file-list>
<welcome-file>/abc.jsp</welcome-file>
</welcome-file-list>
and also when someone types www.example.com/something, even then application should direct to abc.jsp, but the url pattern shouldnt be compromised.
In other words, you'd like to forward non-existing resources (which thus would result in a HTTP 404 Page Not Found error) to the same file? Then define it as an <error-page>
in the web.xml
as well:
<error-page>
<error-code>404</error-code>
<location>/abc.jsp</location>
</error-page>
But your question is actually a bit ambiguous. If you actually didn't mean the above and actually want to use /abc.jsp
as the "page controller", then you need to define it as a <servlet>
in web.xml
instead:
<servlet>
<servlet-name>controller</servlet-name>
<jsp-file>/abc.jsp</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>controller</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
(both the <welcome-file>
and the <error-page>
are not needed here)
This is however a flaw in the MVC design (using a view as controller). But if you're actually asking for it..