Creating Java WebApp with JPA
Last updated: 2025-09-14
J-Framework Web project simplifies building Java database driven web applications based on JSF and PrimeFaces and JPA. This example will create CRUD (Create, Read, Update, Delete) operations of Person information.
All the following components could be generated with few clicks using Smart-API Low-Code No-Code platform. |
Usage:
-
Create Maven project with the following pom.xml:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-webstack/java-web-jsf-jpa-tutorial.adoc - include::inc/jpa/pom.xml[]
If you are using Eclipse, be sure to refresh your project (select your project→ right click→ Maven→ Update Project) |
-
[Optional] Create config file at src/main/resources/config.properties with the following contents:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-webstack/java-web-jsf-jpa-tutorial.adoc - include::inc/jpa/src/main/resources/config.properties[]
-
Create Model class in src/main/java/com/app/person/Model.java with the following contents:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-webstack/java-web-jsf-jpa-tutorial.adoc - include::inc/jpa/src/main/java/com/app/person/Model.java[]
-
Create controller (JSF Managed Bean) at src/main/java/com/app/person/Controller.java with the following contents:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-webstack/java-web-jsf-jpa-tutorial.adoc - include::inc/jpa/src/main/java/com/app/person/Controller.java[]
-
Create JSF XHTML Page at src/main/webapp/index.xhtml class with the following contents:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-webstack/java-web-jsf-jpa-tutorial.adoc - include::inc/jpa/src/main/webapp/full.xhtml[]
-
Create App class in src/main/java/com/app/App.java with the following contents:
Unresolved include directive in modules/6.x.x/pages/frameworks/jk-framework/jk-framework-webstack/java-web-jsf-jpa-tutorial.adoc - include::inc/jpa/src/main/java/com/app/App.java[]
Thats it, now run your App class, in few seconds your browser will open and you should see something like this:

Full example source-code can be found at https://github.com/smartapi-com/j-framework-web-jpa |