13
Introduction to Ozark HASUNUMA Kenji GlassFish Community [email protected]

Introduction to Ozark

Embed Size (px)

Citation preview

Page 1: Introduction to Ozark

Introduction to Ozark

HASUNUMA KenjiGlassFish [email protected]

Page 2: Introduction to Ozark

Road to GlassFish 5

• 2013-06 : GlassFish 4.0

• 2014-09 : GlassFish 4.1

• 2015-00 : GlassFish 4.2

• 2016 Q3 : GlassFish 5.0

Now!

Page 3: Introduction to Ozark

New feature of GlassFish 5

• JCache (JSR 107)

• Java API for JSON Binding (JSR 367)

• Model View Controller (JSR 371)

• Servlet 4.0, CDI 2.0, and more ...

Page 4: Introduction to Ozark

JSR 371 MVC (RI: Ozark)

ControllerJAX-RS

View<<Any>>

ModelCDI

WEB-INF/views/** CDI Bean or Map

W/ @Controller

Page 5: Introduction to Ozark

Controller (String)@Path("hello")@RequestScopedpublic class HelloController { @GET @Controller public String hello() { return "hello.xhtml"; }}

Page 6: Introduction to Ozark

Controller (@View)@Path("hello")@RequestScopedpublic class HelloController { @GET @Controller @View("hello.xhtml") public void hello() { }}

Page 7: Introduction to Ozark

Controller (Viewable)@Path("hello")@RequestScopedpublic class HelloController { @GET @Controller public Viewable hello() { return new Viewable("hello.xhtml"); }}

Page 8: Introduction to Ozark

Controller (Response)@Path("hello")@RequestScopedpublic class HelloController { @GET @Controller public Response hello() { return Response.ok() .entity("hello.xhtml").build();} }

Page 9: Introduction to Ozark

@InjectGreeting greeting;!

@Controller @GET@View("hello.xhtml")public void hello() { greeting.setMessage("Hello!");}

Model (CDI Bean)<p>${greeting.message}</p>

hello.xhtml

Page 10: Introduction to Ozark

@InjectModels models;!

@Controller @GET@View("hello.xhtml")public void hello() { models.put("message", "Hello!");}

Model (Map)<p>${message}</p>

hello.xhtml

Page 11: Introduction to Ozark

View (Ozark supports)View Engine Ext. (determiner)

JSP .jsp .jspxFacelets .xhtml

FreeMarker .ftlHandlebars .hbs .handlebarsMustache .mustacheThymeleaf .html

Velocity .vm

Page 12: Introduction to Ozark

Conclusion: Ozark is ...

• JSR 371 (a part of Java EE 8) RI

• Consisted of JAX-RS and CDI

• Using existing templates

• Based on Jersey MVC Framework(Why NOT include JAX-RS?)

Page 13: Introduction to Ozark

Introduction to OzarkHASUNUMA KenjiGlassFish [email protected]