Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mvc 1.0 - by Example @JEEConf 2015

Mvc 1.0 - by Example @JEEConf 2015

Overview, introduction and code samples. Includes links and how to get started.

ivargrimstad

May 22, 2015
Tweet

More Decks by ivargrimstad

Other Decks in Programming

Transcript

  1. @ivar_grimstad JEEConf 2015 @Controller @Path(“hello”)
 public class HelloController { @GET

    public Viewable hello() { return new Viewable(“hello.jsp”); }
 }
  2. @ivar_grimstad JEEConf 2015 @Controller @Path(“hello”)
 public class HelloController { @GET

    public Response hello() { return Response.status(OK) .entity(“hello.jsp”) .build(); }
 }
  3. @ivar_grimstad JEEConf 2015 @Named(“greeting”) @RequestScoped
 public class Greeting { private

    String message; public void setMessage(String message) { this.message = message; } public String getMessage() { return message; } }
  4. @ivar_grimstad JEEConf 2015 @View(“hello.jsp”) @Controller @Path(“hello”)
 public class HelloController {

    @Inject private Greeting greeting; @GET public void hello() { greeting.setMessage(“Hello Kiev”); }
 }
  5. @ivar_grimstad JEEConf 2015 <%@page contentType=“text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head>

    <title>MVC 1.0 Hello Demo</title> </head> <body> <h1>Hello ${greeting.message}</h1> </body> </html>
  6. @ivar_grimstad JEEConf 2015 @View(“hello.jsp”) @Controller @Path(“hello”)
 public class HelloController {

    @Inject private Models model; @GET public void hello() { model.put(“message”,“Hello Kiev”); }
 }
  7. @ivar_grimstad JEEConf 2015 <%@page contentType=“text/html" pageEncoding="UTF-8"%> <!DOCTYPE html> <html> <head>

    <title>MVC 1.0 Hello Demo</title> </head> <body> <h1>Hello ${message}</h1> </body> </html>
  8. @ivar_grimstad JEEConf 2015 Q3 2014 Expert Group formed Q1 2015

    Early Draft Q3 2015 Public Review Q1 2016 Proposed Final Draft Q3 2016 Final Release
  9. @ivar_grimstad JEEConf 2015 Existing Java EE Technologies CDI, JAX-RS, Bean

    Validation New Annotations @Controller @View Community Support Summary