maven webapp to place jsps in /WEB-INF/jsp

前端 未结 2 1596
梦如初夏
梦如初夏 2021-02-06 09:28

I have inherited a webapp built using NetBean\'s internal ant.

All jsps reside in:

WEB-INF/jsp

And the web.xml has hardcoded links to /

2条回答
  •  情话喂你
    2021-02-06 09:30

    What the problem? Let's look at a standard war project structure:

    $ mvn archetype:create -DgroupId=com.mycompany.app \
    > -DartifactId=my-webapp -DarchetypeArtifactId=maven-archetype-webapp
    ...
    $ tree my-webapp/
    my-webapp/
    |-- pom.xml
    `-- src
        `-- main
            |-- resources
            `-- webapp
                |-- WEB-INF
                |   `-- web.xml
                `-- index.jsp
    
    5 directories, 3 files 
    

    No need to configure anything, just put your JSPs under src/main/webapp/WEB-INF/jsp and there you go.

    EDIT: I don't understand why you have the following line in your maven-war-plugin configuration:

    ${basedir}/web/WEB-INF
    

    What is the expected behavior? Why don't you use the default value ${basedir}/src/main/webapp?

提交回复
热议问题