JavaEtMoi Core :: spring-mvc-toolkit - jar

Extension of the Spring MVC module

License

License

Categories

Categories

Spring MVC User Interface Web Frameworks
GroupId

GroupId

com.javaetmoi.core
ArtifactId

ArtifactId

spring-mvc-toolkit
Last Version

Last Version

0.1
Release Date

Release Date

Type

Type

jar
Description

Description

JavaEtMoi Core :: spring-mvc-toolkit - jar
Extension of the Spring MVC module

Download spring-mvc-toolkit

How to add to project

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

Dependencies

compile (9)

Group / Artifact Type Version
org.springframework : spring-webmvc jar 4.0.6.RELEASE
org.springframework : spring-jdbc jar 4.0.6.RELEASE
org.springframework : spring-orm jar 4.0.6.RELEASE
org.springframework : spring-expression jar 4.0.6.RELEASE
org.hibernate : hibernate-validator jar 5.1.1.Final
javax.validation : validation-api jar 1.1.0.Final
org.aspectj : aspectjweaver jar 1.7.4
ch.qos.logback : logback-classic jar 1.1.2
org.slf4j : jcl-over-slf4j jar 1.7.7

provided (2)

Group / Artifact Type Version
javax.servlet : javax.servlet-api jar 3.0.1
javax.servlet.jsp : jsp-api jar 2.0

test (3)

Group / Artifact Type Version
org.springframework : spring-test jar 4.0.6.RELEASE
org.glassfish.web : javax.el jar 2.2.4
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Spring MVC Toolkit

This toolkit provides additional features to the Spring MVC module of the Spring Framework.

Features

  • Input tag supporting HTML 5 form validation by using Bean Validation constraints

Documentation

Html5InputTag

This JSP tag adds HTML 5 form validation to the default Spring MVC input tag by using Bean Validation constraints. It supports:

  • @Max, @Min, @NotNull @Size annotations form the Bean Validation API.
  • Custom @Email, @NotEmpty and @URL annotations from the Hibernate Validator implementation

Here the mapping between Java and HTML 5 code:

Java Code JSP Page Generated HTML 5
@NotEmpty
String firstName;
<jem:input path="firstName" /> <input id="firstName" type="text" required="required" />
@NotNull
String city;
<jem:input path="city" /> <input id="city" type="text" required="required" />
@Size(max=40)
String address;
<jem:input path="address" /> <input id="address" type="text" maxlength="40" />
@Size(max=40)
String address;
<jem:input path="address" maxlength="20" /> <input id="address" type="text" maxlength="20" />
@Min(value=18)
@Max(value=99)
Integer age;
<jem:input path="age" /> <input id="age" type="number" min="18" max="99" />
@Email
String email;
<jem:input path="email" /> <input id="email" type="email" />
@URL
String website;
<jem:input path="website" /> <input id="website" type="url" />
Integer birthYear; <jem:input path="birthYear" /> <input id="birthYear" type="number" />

Tutorial

French articles on the javaetmoi.com blog:

Quick Start

Download the jar though Maven:

<dependency>
  <groupId>com.javaetmoi.core</groupId>
  <artifactId>spring-mvc-toolkit</artifactId>
  <version>0.1</version>
</dependency> 

Spring MVC Toolkit artefacts are available from Maven Central

Demo

Download the code with git:

git clone git://github.com/arey/spring-mvc-toolkit.git

Compile the code with maven:

cd spring-mvc-tookit
mvn clean install

Run jetty

cd spring-mvc-toolkit-demo
mvn jetty:run-war

Open your browser and goto:

Html 5 validation page Screenshot

Contributing to Spring MVC Tookit

  • Github is for social coding platform: if you want to write code, we encourage contributions through pull requests from forks of this repository. If you want to contribute code this way, please reference a GitHub ticket as well covering the specific issue you are addressing.

Development environment installation

Download the code with git: git clone git://github.com/arey/spring-mvc-toolkit.git

Compile the code with maven: mvn clean install

If you're using an IDE that supports Maven-based projects (InteliJ Idea, Netbeans or m2Eclipse), you can import the project directly from its POM. Otherwise, generate IDE metadata with the related IDE maven plugin: mvn eclipse:clean eclipse:eclipse

Release Note

Version Release date Features
0.2.0-SNAPSHOT next version
0.1 30/08/2014 Html5InputTag for HTML 5 validation from Bean Validation constraints

Credits

  • Uses Maven as a build tool
  • Uses Cloudbees and Travis CI for continuous integration builds whenever code is pushed into GitHub

Build Status

Travis : Build Status

Cloudbees Jenkins : Build Status

Versions

Version
0.1