This repository has been archived by the owner. It is now read-only.
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Link Shortener MVC + Bean Validation Example

This example demonstrates a simple Link Shortener webapp demonstrating Jersey MVC and Bean Validation capabilities. There is no validation on the frontend side, every error displayed is recognized on the backend.


The mapping of the URI path space is presented in the following table:

URI path Resource class HTTP methods Allowed values
/ ShortenerResource GET, POST
/r/{link} ResolverResource GET link - shortened link part
/i/{link} PermanentLinkResource GET link - shortened link part

Application is configured by using web.xml, which registers extension to get classes and singletons from it (see class ShortenerApplication). MVC and Bean Validation annotations are present on resource classes (see ShortenerResource, ResolverResource, PermanentLinkResource) as well as on the domain class (see ShortenedLink).

Running the Example

Run the example as follows:

mvn clean package jetty:run

This deploys current example using Jetty. You can access the application at http://localhost:8080/


This examples is using following (3-rd party) front-end frameworks: by spullara - templating engine

Bootstrap by Twitter - front-end HTML/CSS/JS framework