JuvinR
JuvinR

Reputation: 180

How to remove index.jsp from being displayed in URL?

I have a JSP website and don't want it to be displayed as http://www.mywebsite.com/index.jsp. Is there any way to omit the index.jsp from being displayed? I want just my website name as homepage.

Upvotes: 0

Views: 262

Answers (1)

Pino
Pino

Reputation: 9303

If you define index.jsp as a welcome-file you can omit it in the URL, however the URL that explictly references the JSP will still work.

To define that page as a welcome-file add the following block to your web.xml:

<welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
</welcome-file-list>

Upvotes: 1

Related Questions