What is WEB-INF used for in a Java EE web application?

后端 未结 5 658
花落未央
花落未央 2020-11-22 10:39

I\'m working on a Java EE web application with the following source code structure:

src/main/java                 &l         


        
5条回答
  •  遥遥无期
    2020-11-22 10:44

    You should put in WEB-INF any pages, or pieces of pages, that you do not want to be public. Usually, JSP or facelets are found outside WEB-INF, but in this case they are easily accesssible for any user. In case you have some authorization restrictions, WEB-INF can be used for that.

    WEB-INF/lib can contain 3rd party libraries which you do not want to pack at system level (JARs can be available for all the applications running on your server), but only for this particular applciation.

    Generally speaking, many configurations files also go into WEB-INF.

    As for WEB-INF/classes - it exists in any web-app, because that is the folder where all the compiled sources are placed (not JARS, but compiled .java files that you wrote yourself).

提交回复
热议问题