index.jsp default in Java EE project in Netbeans, where?

前端 未结 4 767
自闭症患者
自闭症患者 2020-12-30 09:42

I create a simple web application in Netbeans, named WebApplication1. There is a file created, named index.jsp. When I run the app, browser goes to index.

4条回答
  •  情书的邮戳
    2020-12-30 10:24

    In Netbeans by default, if you create a project with no added frameworks, no deployment descriptor(web.xml) is provided. To change it, right click on the project and select New>Other>web>Standard Deployment Descriptor(web.xml)

    Now edit the web.xml and set

    
        newjsp.jsp
    
    

    In order to change the default to newjsp.jsp

    UPDATE

    Explicitly for tomcat....

    If no web.xml is provided in the application, the default web.xml($CATALINA_HOME/conf/web.xml) of Tomcat is supplied to the application. This deployment descriptor has the following lines:

    
    
    
    
    
    
     
        index.html 
        index.htm     
        index.jsp 
    
    

    That is why the index.jsp is shown by default

提交回复
热议问题