The common library of TERASOLUNA Server Framework for Java (5.x) is a library of useful and obtrusive common functionalities.
The following project are included in TERASOLUNA Server Framework for Java (5.x) Common Library.
SR. NO. | Project Name | Description | Contains java code | Functionalities |
---|---|---|---|---|
1 | terasoluna-gfw-common | Functionality that can be used in general and not just related to the web | Yes |
* Comprehensive Common Exception Handling Mechanism * General exception class (designed as per the needs of this mechanism) * Exception Logger * Exception Codes * Interceptor to output exception log * Improvised System Time handling mechanism (using java.util.Date, java.sql.Date, java.sql.Time, java.sql.Timestamp) * Codelist functionality * Improvised Message handling mechasim * Query excaping utilities for SQL, JPQL * Sequencer classes |
2 | terasoluna-gfw-jodatime | Maven dependency definition and functionality using Joda Time | Yes | * Improvised System Time handling mechanism (using org.joda.time.DateTime) |
3 | terasoluna-gfw-web | Functionalities that will be useful while developing a web application | Yes |
* Transaction Token Mechanism (Mechanism to prevent double submit) * Common Exception Handler * Interceptor to load Codelist * Download View * Group of Servlet filters to output log of information in MDC * Servlet filter parent class * Servlet filter to output tracking Id * Servlet filter to clear MDC * Group of EL functions * Counter-measure for Cross-Site-Scripting * URL encoding functionality * Creating query parameters from JavaBean * JSP tag to display pagination * JSP tag to display output messages after request processes |
4 | terasoluna-gfw-mybatis3 | Maven dependency definition for MyBatis3 | No | * Dependency definition for MyBatis3 |
5 | terasoluna-gfw-jpa | Maven dependency definition for JPA | No | * Dependency definition for JPA |
6 | terasoluna-gfw-security-core | Maven dependency definition for using spring-security (other than web) | No | * Dependency definition for Spring Security (other than web) |
7 | terasoluna-gfw-security-web | Maven dependency definition for using spring-security (web related) and components that extend spring-security | yes |
* Servlet filter to output the authenticated username in log * Redirect handler to counter-measure open redirect vulnerablibility |
In order to start using the common libaries, start with downloading Template Blank Project. Blank project already contains dependecies defined for TERASOLUNA Server Framework for Java (5.x) Common Library. Template Blank Projects are available from the following links:
- https://github.com/terasolunaorg/terasoluna-gfw-web-multi-blank (Recommended)
- https://github.com/terasolunaorg/terasoluna-gfw-web-blank
Common Library can be downloaded using maven through the following settings in pom.xml file.
Two types of settings are possible.
- Using parent
- Without using parent
Irrespective of above two ways, first define the repositories in the pom file.
(The below is required in the both the type of settings.)
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>terasoluna-gfw-releases</id>
<url>http://repo.terasoluna.org/nexus/content/repositories/terasoluna-gfw-releases/</url>
</repository>
</repositories>
Define parent project in pom file
<parent>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-parent</artifactId>
<version>5.0.1.RELEASE</version>
</parent>
After adding above, add the following dependency definitions. (Only the required ones.)
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-web</artifactId>
</dependency>
<!-- OPTIONAL -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-jodatime</artifactId>
<type>pom</type>
<!-- OPTIONAL -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-recommended-dependencies</artifactId>
<type>pom</type>
</dependency>
<!-- OPTIONAL -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-recommended-web-dependencies</artifactId>
<type>pom</type>
</dependency
<!-- If Spring Security is to be used -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-security-web</artifactId>
</dependency>
<!-- If MyBatis3 is to be used -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-mybatis3</artifactId>
</dependency>
<!-- If JPA is to be used -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-jpa</artifactId>
</dependency>
There is no need of settings related to version.
Plugins are also already set in parent.
Add the following dependency definitions.
(Only the required ones.)
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-web</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
<!-- OPTIONAL -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-recommended-dependencies</artifactId>
<version>5.0.1.RELEASE</version>
<type>pom</type>
</dependency>
<!-- OPTIONAL -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-recommended-web-dependencies</artifactId>
<version>5.0.1.RELEASE</version>
<type>pom</type>
</dependency
<!-- If Spring Security is to be used -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-security-web</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
<!-- If MyBatis3 is to be used -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-mybatis3</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
<!-- If JPA is to be used -->
<dependency>
<groupId>org.terasoluna.gfw</groupId>
<artifactId>terasoluna-gfw-jpa</artifactId>
<version>5.0.1.RELEASE</version>
</dependency>
Contributing (bug report, pull request, any comments etc.) is welcome !! Please see the contributing guideline for details.
The common library of TERASOLUNA Global Framework is maintained under 1.0.x branch.
The TERASOLUNA Server Framework for Java (5.x) is released under Apache License, Version 2.0.