Introduction to Ozark

Preview:

Citation preview

Introduction to Ozark

HASUNUMA KenjiGlassFish Communityk.hasunuma@coppermine.jp

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!

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 ...

JSR 371 MVC (RI: Ozark)

ControllerJAX-RS

View<<Any>>

ModelCDI

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

W/ @Controller

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

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

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

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

@InjectGreeting greeting;!

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

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

hello.xhtml

@InjectModels models;!

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

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

hello.xhtml

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

JSP .jsp .jspxFacelets .xhtml

FreeMarker .ftlHandlebars .hbs .handlebarsMustache .mustacheThymeleaf .html

Velocity .vm

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?)

Introduction to OzarkHASUNUMA KenjiGlassFish Communityk.hasunuma@coppermine.jp

Recommended