Spring App Base

Base set of tools and helpers originally designed for use within Spring MVC applications though not restricted to this use-case.

License

License

GroupId

GroupId

com.drunkendev
ArtifactId

ArtifactId

spring-app-base
Last Version

Last Version

1.5.2
Release Date

Release Date

Type

Type

jar
Description

Description

Spring App Base
Base set of tools and helpers originally designed for use within Spring MVC applications though not restricted to this use-case.
Project URL

Project URL

https://github.com/brettryan/spring-app-base
Project Organization

Project Organization

Drunken Dev
Source Code Management

Source Code Management

https://github.com/brettryan/spring-app-base

Download spring-app-base

How to add to project

<!-- https://jarcasting.com/artifacts/com.drunkendev/spring-app-base/ -->
<dependency>
    <groupId>com.drunkendev</groupId>
    <artifactId>spring-app-base</artifactId>
    <version>1.5.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.drunkendev/spring-app-base/
implementation 'com.drunkendev:spring-app-base:1.5.2'
// https://jarcasting.com/artifacts/com.drunkendev/spring-app-base/
implementation ("com.drunkendev:spring-app-base:1.5.2")
'com.drunkendev:spring-app-base:jar:1.5.2'
<dependency org="com.drunkendev" name="spring-app-base" rev="1.5.2">
  <artifact name="spring-app-base" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.drunkendev', module='spring-app-base', version='1.5.2')
)
libraryDependencies += "com.drunkendev" % "spring-app-base" % "1.5.2"
[com.drunkendev/spring-app-base "1.5.2"]

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.commons : commons-lang3 jar 3.5
org.slf4j : slf4j-api jar 1.7.22

provided (18)

Group / Artifact Type Version
org.springframework : spring-context jar
org.springframework : spring-context-support jar
org.springframework : spring-jdbc jar
org.springframework : spring-web jar
org.springframework : spring-webmvc jar
org.springframework.security : spring-security-config jar 4.2.2.RELEASE
org.springframework.security : spring-security-web jar 4.2.2.RELEASE
org.springframework.security : spring-security-taglibs jar 4.2.2.RELEASE
com.fasterxml.jackson.core : jackson-annotations jar 2.8.6
com.fasterxml.jackson.core : jackson-core jar 2.8.6
com.fasterxml.jackson.core : jackson-databind jar 2.8.6
com.fasterxml.jackson.datatype : jackson-datatype-jsr310 jar 2.8.6
org.apache.tiles : tiles-extras jar 3.0.7
javax.mail : javax.mail-api jar 1.5.6
org.apache.httpcomponents : httpclient jar 4.5.3
net.sf.uadetector : uadetector-resources jar 2014.10
javax.servlet : javax.servlet-api jar 3.1.0
javax.servlet.jsp : javax.servlet.jsp-api jar 2.3.1

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Spring App Base

Base set of tools and helpers originally designed for use within Spring MVC applications though not restricted to this use-case.

A Note on Dependencies

Spring App Base intentionally uses provided scope for most dependencies, the only transient dependency included is apache commons-lang as it's almost used everywhere.

This strategy allows you to control your dependencies. For example you may choose to use the spring MVC helpers but not wish to include spring-security.

For each component required dependencies will be listed which must be included at runtime.

JDBC Tools

SQL File Parser

JdbcHelper.getSql has overloaded methods to take an InputStream or path to return a string of the streams contents stripping SQL like comments

  • Line comments -- are removed.
  • Block comments /* */ are removed.

Usage

// Import the static method getSql.
import static com.drunkendev.jdbc.JdbcHelper.getSql;

// Get SQL from a file on the filesystem.
// A path object overload is also available as of 1.1.
String sql = getSql("script.sql");

// A good use case is storing your SQL resources in the same packages as a
// service class.
String sql = getSql(App.class.getResourceAsStream("script.sql"));

ResultSetExtractor factories

JdbcHelper.singletonExtractor and JdbcHelper.singletonOptionalExtractor provide convenience methods for building new single record extractors from a given RowMapper. This can be used as follows.

private static final RowMapper<Customer> MAPPER_CUST = (rs, i)
        -> new Customer(
                rs.getLong("ID"),
                rs.getString("NAME"),
                rs.getString("EMAIL"));
private static final ResultSetExtractor<Customer> EXTRACTOR_CUST
        = singletonExtractor(MAPPER_CUST);

JdbcManager

Query Cache

Mail Queue

Menu Builder

JSR-310 taglib

App Config

  • combined property sources.
  • taglib

Userlog

Other

  • IE Compatibility Filter

FileUtils

FileUtils contains unchecked versions of methods from java.nio.file.Files for convenience use within lambda expressions.

Versions

Version
1.5.2
1.5.1
1.5.0
1.4.0
1.3.3
1.3.2
1.3.1
1.3.0
1.2.0
1.1.0
1.0.0