Born To Simplify Java Web Application Development
- Do you struggle with the design of a unified exception system with high scalability?
- Do you struggle with the lack of Rest API request/response logs?
- Do you struggle with the lack of a powerful Http request tool?
- Do you struggle with the configuration of a trivial and cumbersome logging system?
- Do you struggle with the interconversion between basic data types and the assignment of default values to parameters?
If you answered yes, then I would strongly recommend you to use the hygge-project
.
Building Block | Description |
---|---|
hygge-commons | hygge core entity(includes Exception、POJO) |
hygge-commons-spring-boot | For initializing HyggeSpringContext to provide support to other modules |
hygge-logging | Simplify the logging framework configuration and make the logs have good support for exporting json format records |
hygge-util | Tools for data transformation, validation, iteration, etc. |
hygge-web-toolkit | Provide web application development template tools and network request tools |
Java SDK v1.8 or higher
Warning: this project relies on spring-boot, and if spring-boot
drops support for lower versions of java in the future, this project will also drop support for lower versions of java.
hygge-web-toolkit
is designed as a starter
for spring-boot
. It also depends on other libraries, and the
following dependencies, which you no longer need to add manually, will be added to the project automatically:
- Hygge-Project
- hygge-commons
- hygge-commons-spring-boot
- hygge-logging
- hygge-util
- Third Party Dependencies
- spring-boot-starter-web
- spring-boot-starter-aop
- httpclient
After you import the hygge-web-toolkit
into your project, you will obtain the following features
of hygge-project
:
- Global unified semantic exceptions.
- Automatically configure the logging framework so that the application has good support for outputting
json
format logs. The following logging frameworks are supported:- logback
- log4j
- Network request tool based on
RestTemplate
, each API call can be individually configured with parameters such as timeout time, automatic request logging, providing convenient and practical syntax sugar. - Some data validation, fetching, iterating and other tools that are often needed in your development.
- Standardized exposed endpoint template tool.
- Automatic logging the request and response for exposed endpoints.
- Make sure you provide the name for the application.
- For example: You have to add
spring.application.name
to yourapplication.properties
spring.application.name=xxx
- For example: You have to add
- Make sure you provide the "-parameters" compiler flag.(If you are using a version of
hygge-project
greater than or equal to 0.15 )- For example: You can configure your
org.apache.maven.plugins
inpom.xml
as follows<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.10.1</version> <configuration> <compilerArgument>-parameters</compilerArgument> <!-- depending on your project --> <source>8</source> <!-- depending on your project --> <target>8</target> </configuration> </plugin>
- For example: You can configure your
If you are using Maven just add the following dependency to your pom.xml:
<dependency>
<groupId>io.github.soupedog</groupId>
<artifactId>hygge-web-toolkit</artifactId>
<version>${latest.version}</version>
</dependency>
hygge-web-toolkit
relies on spring-boot
related components, but no forced dependency about the spring-boot
version, you can specify special versions in any of the following ways
-
<parent/>
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>${Your specific spring-boot version}</version> <relativePath/> <!-- lookup parent from repository --> </parent>
-
<dependencyManagement/>
<dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>${Your specific spring-boot version}</version> </dependency> <!-- Omit the other spring-boot components you need--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>${Your specific spring-boot version}</version> </dependency> </dependencies> </dependencyManagement>
The basic runnable sample project: web-application-example