Deepak Singh
Deepak Singh

Reputation: 460

how to call index.jsp as default when Run my application

I have created a web dynamic project and created a folder as view name under the WebContent folder. I kept the index.jsp file inside the view folder.

I want to make it so that when i run my application, it will by default display the index page. It is working when keep it inside the webcontent folder but when i put it inside the view folder i am getting an error message (page is not available)

How can I resolve this problem in eclipse?

Upvotes: 0

Views: 662

Answers (1)

PacMan
PacMan

Reputation: 1358

it's all simple , you can configure it in your web.xml file by adding these tags

    <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
  <display-name>name you want to see</display-name>
  <welcome-file-list>
    <welcome-file>view/yourFile.jsp</welcome-file>
  </welcome-file-list>
</web-app>

and it will be loaded as the first page while running your application

Upvotes: 1

Related Questions