wicket-jsr303-parsley

Basic integration between Wicket, JSR303 and ParsleyJS client side validation library

License

License

Categories

Categories

Wicket User Interface Web Frameworks
GroupId

GroupId

com.code-troopers
ArtifactId

ArtifactId

wicket-jsr303-parsley
Last Version

Last Version

0.3
Release Date

Release Date

Type

Type

jar
Description

Description

wicket-jsr303-parsley
Basic integration between Wicket, JSR303 and ParsleyJS client side validation library
Source Code Management

Source Code Management

https://github.com/code-troopers/wicket-jsr303-parsley

Download wicket-jsr303-parsley

How to add to project

<!-- https://jarcasting.com/artifacts/com.code-troopers/wicket-jsr303-parsley/ -->
<dependency>
    <groupId>com.code-troopers</groupId>
    <artifactId>wicket-jsr303-parsley</artifactId>
    <version>0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.code-troopers/wicket-jsr303-parsley/
implementation 'com.code-troopers:wicket-jsr303-parsley:0.3'
// https://jarcasting.com/artifacts/com.code-troopers/wicket-jsr303-parsley/
implementation ("com.code-troopers:wicket-jsr303-parsley:0.3")
'com.code-troopers:wicket-jsr303-parsley:jar:0.3'
<dependency org="com.code-troopers" name="wicket-jsr303-parsley" rev="0.3">
  <artifact name="wicket-jsr303-parsley" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.code-troopers', module='wicket-jsr303-parsley', version='0.3')
)
libraryDependencies += "com.code-troopers" % "wicket-jsr303-parsley" % "0.3"
[com.code-troopers/wicket-jsr303-parsley "0.3"]

Dependencies

compile (5)

Group / Artifact Type Version
org.apache.wicket : wicket-core jar [6.0.0,]
org.apache.wicket : wicket-bean-validation jar [0.8,]
de.agilecoders.wicket.webjars : wicket-webjars jar 0.2.0
org.webjars : parsleyjs jar 1.1.15
org.hibernate : hibernate-validator Optional jar 4.3.1.Final

provided (1)

Group / Artifact Type Version
org.eclipse.jetty.aggregate : jetty-all-server jar 8.1.10.v20130312

test (1)

Group / Artifact Type Version
junit : junit jar 4.11

Project Modules

There are no modules declared in this project.

Wicket JSR303 ParsleyJs integration

Thanks to Cloudbees buildhive for providing a free Jenkins instance. Build Status

Parsley.js is a client-side form validation library (documentation).

Apache Wicket is a Java Web framework providing clean separation between markup and logic.

JSR303 - Bean validation is a Java specification providing an easy way to define constraint on your model objects.

This project provides a simple way to get client side validation for POJOs annotated with Bean Validation's constraints.

Setup on your project

Add the following Maven dependency

<dependency>
    <groupId>com.code-troopers</groupId>
    <artifactId>wicket-jsr303-parsley</artifactId>
    <version>0.2</version>
</dependency>

To use it in your Wicket application, you will need to register Parsley with your application. Basically, you will add this code in your Application#init() method :

@Override
public void init(){
    super.init();
    Parsley.register(this);
}

For every form that you want to validate using Parsley, you will need to add ParsleyFormBehavior to your Form :

Form form = new Form("form");
form.add(new ParsleyFormBehavior());

Every FormComponent in the specified Form will get a correct validator (both client and server side). Please notice that you will need to use a model implementing IPropertyReflectionAwareModel in order for the tool to read annotation metadata.

JavaScript dependencies

This library depends on Parsley.Js via the artifact deployed on Webjars. This way you can easily use an updated version of the library in your project.

Bug tracker

Have a bug? Please create an issue here on GitHub!

https://github.com/code-troopers/wicket-jsr303-parsley/issues

Special notes

Many thanks to Martin Grigorov for the blog article which inspired me : http://wicketinaction.com/2013/04/server-and-client-side-validation/

Thanks to James Ward for the Webjars.org initiative : http://www.jamesward.com/2012/10/31/webjars-officially-launched.

The implementation provided here is open for pull request or further integration into WicketStuff.

Copyright and license

Copyright 2012 Code-Troopers.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

com.code-troopers

Code-Troopers

Versions

Version
0.3
0.2
0.1