Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

72 lines (50 sloc) 1.91 KB

aerogear-controller-demo - very lean mvc controller

how to create a new project

basic use case

  1. add the maven dependency

  2. create a pojo controller

    public class Home {
        public void index() {
  3. create a Java class containing the routes (must extend AbstractRoutingModule)

    public class Routes extends AbstractRoutingModule {
    public void configuration() {
  4. create a jsp page at /WEB-INF/pages/<Controller Class Name>/<method>.jsp

    <!-- /WEB-INF/pages/Home/index.jsp -->
            <p>hello from index!</p>

parameter population

You can use immutable beans straight away as controller parameters:

    public class Store {
        public Car save(Car car) {
            return car;

This can be populated by putting a route to it (preferrably via post, of course)


And you can use a simple html form for it, by just following the convention:

        <input type="text" name="car.color"/>
        <input type="text" name="car.brand"/>

The car object will be automatically populated with the provided values - note that it supports deep linking, so this would work fine too:

        <input type="text" name="car.brand.owner"/>

All the intermediate objects are created automatically.

Jump to Line
Something went wrong with that request. Please try again.