官术网_书友最值得收藏!

Building the project

When we build the project, Maven will cause the required file to be downloaded and added to our local Maven repository. It will copy the file into the WEB-INF/lib folder of the build target.

If we right-click on the project and select Build, Maven will do its magic. When it is finished, we can use the Files view to see the result. Click on the Files tab. Then open the project tree view. You will see an src and a target folder, as well as the project's pom.xml file and the NetBeans project configuration files.

Open the target folder. Then expand the PFThemes-1.0-SNAPSHOT folder. As we are confident that the build process will have worked correctly, we can now see the structure of the web application:

Building the project

Tip

The Java EE 7 standard mandates a formal folder structure for web applications. The META-INF and WEB-INF folders are where application-specific resources are stored. Under WEB-INF, you will see a classes folder, a lib folder, and several configuration files. Don't worry if you don't see any or all of the configuration files. Only web.xml is generated by default; the others will be created later in this chapter. The classes folder is to where Java classes are compiled. The lib folder is where JAR files, such as the PrimeFaces JAR file, are added.

Although PrimeFaces does not require any additional dependencies, GlassFish does check each JAR file for optional dependencies and treats them as mandatory ones. Because of this rather petty strictness, we also need to add the commons-fileupload and commons-io dependencies. These are only required for the PrimeFaces fileupload component, which won't be used here. At the time of writing this book, GlassFish does not allow applications to be run with unsatisfied dependencies. So, we need to add the missing dependencies.

Add a dependency as you did before, but this time type in commons-fileupload in the query field and select version 1.3.1. Don't forget to click on Add before adding the commons-io dependency. For this, you select the 2.1 version.

主站蜘蛛池模板: 峨边| 会宁县| 永春县| 璧山县| 榆树市| 岳西县| 电白县| 襄樊市| 区。| 达拉特旗| 西盟| 龙州县| 启东市| 云林县| 清流县| 乌拉特中旗| 承德县| 平远县| 贵定县| 肥东县| 吴川市| 云浮市| 黄龙县| 南雄市| 当涂县| 维西| 南郑县| 东乡族自治县| 钟山县| 鄂州市| 安溪县| 辉南县| 临泉县| 香格里拉县| 宁强县| 通化县| 岑巩县| 房产| 山西省| 临沂市| 马鞍山市|