J-Framework Web
J-Framework Web is a set of APIs, components, and practices for building Java web applications based on JSF and PrimeFaces.
Dependency
Most likely, you will NOT need to add direct dependency to this project, since it’s already included in the parent projects or the other framework projects. However, if you need to, the dependency is as follows.
<!-- https://mvnrepository.com/artifact/com.jalalkiswani/j-framework-core -->
<dependency>
<groupId>com.jalalkiswani</groupId>
<artifactId>j-framework-web</artifactId>
<version>7.0.2</version>
</dependency>
Basic Usage
-
Create an
Appto run your application easily, it should look something like this:
package com.app;
import com.jk.web.embedded.JKWebApplication;
public class App {
public static void main(String[] args) {
JKWebApplication.run();
}
}
Features
-
Run Faces 4.0, PrimeFaces 12, Weld CDI 4, OmniFaces and others on Tomcat with Zero-Config.
-
Designed, developed, and tested for clean
hot-deploymentsfeature in mind. -
Includes the following JSF configurations out of the box:
-
FacesServletconfigurations and mapping. -
index.xhtmlas the default page in each directory. -
Set the default
time-zoneof JSF to take thesystemtime-zone. -
Set the project stage to
developmentandFACELETS_REFRESH_PERIODto0by default for easier development.
-
-
Includes the following PrimeFaces configuration out of the box:
-
Enable
primefaces.SUBMITto partial for better performance. -
Set
primefaces.MOVE_SCRIPTS_TO_BOTTOMto true to have a cleaner code. -
Set default Prime Faces theme to
nova-light.
-
Utilities
Include a set of utility Servlets such as:
-
JKLogoutServletmapped at/logout2. -
JKVersionsServletmapped at/version. -
JKResetConfigServletmapped at/config/reset.
Filters
Includes a set of utility filters, such as:
-
JKDefaultFilterwhich handles multiple stuff such as syncingcontextinformation. -
JKSetCharacterEncodingFilterwhich sets the encoding toUTF8.-
Includes a set of listeners, such as:
-
JKWebContextListener.
-
-
-
JKNoCacheFilterwhich handles filtering resources that don’t need to be cached.
Controllers
Includes a set of Faces controllers, such as:
-
JKWebControllerwhich shall be the super class for any Faces controller. -
JKUtilWebControllermapped atutil. -
JKWebMessagesController.
Built-In Converters
Include a set of useful faces converters, such as:
-
JKDateConvertor -
JKPasswordConvertor -
JKTimeConvertor -
JKTimeStampConvertor -
JKTypeConvertor
Exception Handlers
The project sets Faces exception handlers to the following handlers, which are based on PrimeFaces exception handlers.
-
JKFacesExceptionHandlerFactory -
JKFacesExceptionHandler
Utilities and Wrappers
The project contains many utilities and wrappers, such as:
-
JKJsfUtil -
JKWebUtil
And many others, please refer to the API Documentation for more details.
|
For production environment config, please have a look at Faces Recommendations. |