JSF Code Generator

Read here, how to simply get a webapplication to maintain the data in your database

CRUD Webapplication

The Basics

 

Download these components

  • a Java IDE
  • Apache Tomcat
  • Primefaces
  • JSF-API
  • JSF-IMPL

It is important to configure the connection pool to establish the DB connection.

THE Java Objects

 

I'm using a pure Java-Bean to map the table to java. If you need to have an interaction with the DB within a data table, you need to create the Bean also as a managed bean to have it staetfull.

The managed bean is the controller, that glues all together. It contains the CRUD-functions, the data table reader, the XLSX-exporter and the messages part.

You need to edit your web.xml to set the name of the JDBC-connection as parameter 'jdbcConnection'.

the JSF page

 

The JSF-page can be generated as a complete page or as an import. You might do some changes to this generated piece of code to make it 'your' page. Have fun with the different layout possibilites of HTML.

 

 

A first CRUD webapplication with JSF

Open the SQL-Monitor of SQLadmin. Go to the DB-Objects tree and find the table you want to make available on the  web. Right click on the table and select 'Code' . You need to set the package name and if you do not like the autogenerated name, just overwrite it. Then click the cylinder-symbol to get the code.

Some impressions