Get started with configuring the JSF development environment in IntelliJ idea

Source: Internet
Author: User
Tags glassfish

JSF as the official Java EE Standard, after understanding and mastering its basic development technology, for the high functional requirements, business process complex of the various modern Web application development will become very suitable and powerful high-efficiency development tool. The development environment of JSF involves configuring the Web application Server in IntelliJ idea, configuring the Java EE Basic Environment, choosing the JSF-related function module, etc., and choosing idea as the development environment because idea is recognized as the industry's most The strong Java integrated development environment has become a de facto standard for Java and related application development environments, and even Google's official Android Studio is built on idea. The following text and graphics for idea + JSF environment configuration detailed:

1. Download the latest IntelliJ idea Ultimate version (non-community version). Since idea 15 and previous versions have bugs with the latest version of GlassFish Server support, you should use the latest version of Idea, which is the latest version of the 2016.2.4 edition.

2. Download the latest version of GlassFish Server. GlassFish server is a Java EE-compliant application server that can support JSF in a perfect way. The common Tomcat is just a Servlet container and does not implement all Java EE specifications, so it does not count as a Java EE application Server and does not support JSF. GlassFish download installation and start-up is very simple, see its official website description, the current version is the 4.1.1 version, note Be sure to download the Java EE 7 full Platform version. You can start GlassFish Server after you download it.

3, start idea, set Preferences-Build, execution, Deployment-application Servers, click the "+" button, as shown:

4, click the "+" button, select Add GlassFish Server, in the Pop-up dialog box, specify the GlassFish server installation directory, you can click the "..." button next to the File Directory dialog box to select GlassFish Server directory, Linux/mac under/opt/glassfish,windows such as D:\glassfish (assuming you unzip the GlassFish Zip installation package to d:\glassfish), as shown in:

5. In the "Additional Libraries for Frameworks" list on the right, tick "cdi:contexts and Dependency Injection" and "JSF", as shown in:

Then, click on the "OK" button in the bottom right corner to complete the GlassFish Server setup in idea.

6, create a module in the existing project (or new project), the module type on the left select "Java Enterprise", the right "Additional Libraries for Frameworks" list, tick "Web Application "," JSF "," Cdi:contexts and Dependency injection "three items, in particular, when checking JSF and CDI two, the following Libraries must select" Use Librarie from ' GlassFish 4.1.1 ' installation ', as shown:

Click "Next" in the lower right corner to complete the Module creation as prompted, and you can begin writing JSF XHTML views and Managed beans.

7, to start running a JSF Module in idea, you can press the shortcut key ALT+SHIFT+F10, or click the menu run ..., in the pop-up menu, select "0. Edit configurations ... "menu item as shown in:

8. In the Popup Run dialog box, select "GlassFish Server" in the list on the left and click the "+" button in the upper left corner as shown:

9. In the pop-up menu, select GlassFish Server, Local, as shown in:

This creates a new JSF Module run configuration.

10. Modify this run configuration, set the name of the Module you specified, then click on the "Deployment" tab, tick "Use custom context root:" and enter the URL you specified in the following input box to access the root path, such as/ Jsfapp, so your JSF app can be accessed through Http://server/jsfapp, as shown in:

11, click on the "Server" tab, "on" Update "action" set to redeploy, "Server Domain" is set to Domain1 (usually the default is Domain1), fill in the corresponding user name, password (access GlassFish Server Administrator Console Administrator username password, then click on the "Apply" button in the lower right corner, so that the JSF Module run configuration is complete, of course, you can directly click the "Run" button to run immediately, As shown in the following:

12. Once you have created the run configuration of this JSF Module, you can do so at any time via the menu run ... To run this JSF module, after clicking on the menu item above, in the popup menu, you can directly select the JSF module run configuration name to run the JSF module, as shown in:

At this point, a complete idea of the GlassFish Server-based JSF Development runtime environment is set up.

Get started with configuring the JSF development environment in IntelliJ idea

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.