0

I'm not sure how to start on this, but I currently have a simple application that has a home page url of

localhost:8080/projectName/homePage.jsp

However, I'd like it so that

localhost:8080/projectName/ 

OR

localhost:8080/projectName

sends me to the homePage.jsp.

I've read about an index.jsp that was created by eclipse in other projects, but it seems like that hasn't been done for me - do I need to create this? I'm not using a web.xml, and am instead relying on @WebServlet to do wiring.

praks5432
  • 7,246
  • 32
  • 91
  • 156

2 Answers2

0

2 ways to do this. 1. Add an entry in web.xml as follows

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

2. create an index.jsp file in your WebContent folder and forward the request to homePage.jsp

Konza
  • 2,143
  • 17
  • 30
0

According to the following post there is no such way possible with annotation:

Servlet 3.0 annotations <welcome-file>

Community
  • 1
  • 1
Amit
  • 59
  • 3
  • 9