JSF Application in Just Two Clicks
IntelliJ IDEA Java EE support was beefed up with the very interesting feature. Now you can build a database Web interface in literally a few mouse clicks. Well, okay, at least get yourself a starting point, which is way better that beginning from scratch.
I must note that there are some prerequisites, though:
- A Web Module that is used to host the Persistence Unit
- Persistence Unit that is used to encapsulate the database access
Details about creating Web modules, Persistence Units and mapping them to various datasources can be found in the IntelliJ IDEA built-in help, under Java EE Support, EJB Support and Web Application Development sections.
After the prerequisites are met, follow this simple step-by-step procedure:
Remember to switch to the Java EE View for performing the steps below
- Right-click the Persistence Unit and select Generate Faces Pages
- In the Create application files in field type the path where you want to store all the generated files.
- In the Create Manage Beans in package specify the package where you want to create the Managed Bean classes.
- From the Store facelets configuration list select the JSF configuration file where JSF configuration descriptor will be placed. This list contains all JSF configuration files eligible for the project.
- In the Use this suffix for Managed Bean names specify the suffix that is added all generated Managed Bean names.
- Select the Create separate subdirectory for each of the entities if you want to create separate folder for each of the entities and place all generated files that are used to access that entity.
If you clear this option, the Automatically generate page names is selected to prevent from ambigous file names.
After the settings are configured, define what pages you want to generate:
- Under the Entity column select what entities you want to generate interface pages for.
- Under Edit, View, List, Create columns select what template should be used to generated the data access pages. Note that selecting a template from the column header overrides setting for the entire column.
Remember that templates can be managed through the File Templates dialog and so you have the option to create the data access pages from your custom templates that contain functionality and layout of your choice.
- Under Managed Bean column select template that will be used to generate the Managed Bean code.
- Select a tab below the table to examine what code will be generated for each of the pages.
- Click Generate.
IntelliJ IDEA generates the specified application files and you can try it by compiling and deploying the module to an application server.
Download the 6.0.2 release of IntelliJ IDEA and try this feature. You may also want to join IntelliJ IDEA EAP and watch the latest improvements and additions.
Subscribe to Blog updates
Top 10 UI Updates in IntelliJ IDEA for 2023
Hey there, fellow developers! Today, we want to share the most significant UI updates from 2023 that have transformed how IntelliJ IDEA looks and functions. New UI Of course, the highlight of our recent updates was the launch of our new, clean, and modern UI. This was first announced at the en…
The What, Why, and How of JPA Buddy in IntelliJ IDEA
Master JPA entity management with JPA Buddy in IntelliJ IDEA! Our latest article shows you how to simplify your workflow and reduce boilerplate code.
The Best of IntelliJ IDEA’s HTTP Client
In today's fast-paced tech world, easy and efficient management of web services and APIs is crucial. That's where IntelliJ IDEA's HTTP Client steps in, turning complex HTTP requests into a walk in the park. The HTTP Client is a feature-rich, text-based tool in IntelliJ IDEA Ultimate. It seamlessl…
Import Postman Collections to the HTTP Client
We know that many of you use Postman collections and want to stay in the flow while working with them. This means staying inside IntelliJ IDEA and not switching to a different app. Great news! You can now effortlessly transform Postman collections into .http and use them in the HTTP Client …