SlideShare a Scribd company logo
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Getting Start
Java EE Action-Based MVC
With Thymeleaf
Masatoshi Tada (Casareal ,Inc)
JJUG CCC 2016 Spring
2016-5-21(Sat)
1
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
About This Session
! Answer Your Question "Java EE is Useful
Framework As Next Struts?"
! View is Thymeleaf !
! Code on GitHub
! https://github.com/MasatoshiTada/jjug-action-based-
mvc
! Sorry, comments are written in Japanese
2
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
About Me
! Masatoshi Tada
!Casareal, Inc
!GlassFish User Group Japan
!Trainer(Java EE/Spring/Swift)
!Twitter:@suke_masa
3
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Agenda
① What’s "Action-Based MVC"?
② Getting Start MVC 1.0(EE 8)
③ Using Jersey MVC & RESTEasy HTML in
EE 7
④ Other Java EE Technologies You Should
Know
⑤ Final Conclusions
4
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
①What’s
"Action-Based MVC"?
5
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
What’s Action-Based MVC?
! Web Framework which focuses HTTP
request & response
! Most of framework are Action-Based
! Struts, Spring MVC, …
6
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
What’s Action-Based MVC?
7
View
View
Controller Model
request
response
Struts developer friendly
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
What’s "Component-Based MVC"?
8
View
Backing
Bean
Model
GUI(VB, Android…) developer friendly
-> Struts developer Un-Friendly
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Web Framework of Java EE
! JSF
! Responses HTML
! Component-Based
! JAX-RS
! Responses JSON/XML
! Action-Based
9
There’s no Framework
which is "Action-Based"
and "Responses HTML"
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Java EE Standard Action-Based MVC!!
! Model-View-Controller API (MVC 1.0)
! Java EE 8 (2017 H1)
! Based on JAX-RS
10
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
②Getting Start
MVC 1.0
11
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
MVC 1.0
! MVC 1.0 is Specification
! ≒Set of Interfaces, Annotations, and Exceptions
! Reference Implementation is Ozark
! Set of Implementation Classes of above
interfaces
12
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Main Functions of Struts
! Controller
! Validation
! Handling Exception
! View Technology
! Transaction Token
13
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
in MVC 1.0?
! Controller → ⭕
! Validation → ⭕
! Handling Exception → ⭕
! View Technology → ❌
! Transaction Token → ❌
14
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Why No View Technologies in MVC?
! Non-Goal 1 of MVC specification

"Define a new view (template)
language and processor."
! Instead, MVC provides integration with
many view technologies!
15
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
View Technologies
We Can Use in MVC 1.0
! MVC
! JSP, Facelets
! Ozark
! Thymeleaf, Mustache, Freemarker,

Handlerbars, Velocity, AsciiDoc, …
16
If you want to use other View,
Implement ViewEngine interface
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Problems of JSP and Facelets
17
! JSP
! Mix of Logic and View
! Sometime Occurs XSS
! Facelets
! Cannot Use All Features in MVC 1.0
! Bad Compatibility with JavaScript
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Let’s Use Thymeleaf!
18
! Pure HTML!
! Isolate View and Logic absolutely!
! Good Compatibility with JavaScript!
! Link Expression is very useful!
! Internationalizing message!
! http://www.thymeleaf.org/doc/tutorials/2.1/
usingthymeleaf.html#a-multi-language-welcome
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Using Thymeleaf in MVC 1.0
19
<dependency>
<groupId>org.glassfish.ozark.ext</groupId>
<artifactId>ozark-thymeleaf</artifactId>
<version>1.0.0-m02</version>
<scope>compile</scope>
</dependency>
! Just adding dependency like below
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Why No Transaction Token Feature?
! In Expert Group’s Mailing-List, 

"This is a client side concern"
! https://java.net/projects/mvc-spec/lists/
jsr371-experts/archive/2015-07/message/2
! Spring MVC has no transaction token
feature, too.
20
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
How to Avoid Double-Submit-Problem
! See TERASOLUNA Guideline
! http://terasolunaorg.github.io/guideline/
5.1.0.RELEASE/en/ArchitectureInDetail/
DoubleSubmitProtection.html
21
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Preparation : Enabling JAX-RS
22
@ApplicationPath("/api")
public class MyApplication extends Application {
}
Inherit Application class
Add Annotation
jjug-mvc10/src/main/java/com/example/rest/MyApllication.java
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Basic Controller
23
@Path("/employee")
public class EmployeeController {
@GET @Path("/index")
@Controller
public String index() {
return "employee/index.html";
}
} Path of View
(extention is REQUIRED)
Indicate as controller
method
Mapping to URL &
HTTP method
※Italic is feature of MVC
jjug-mvc10/src/main/java/com/example/rest/controller/EmployeeController.java
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Form Class
24
public class EmployeeIdForm {
@QueryParam("id")
@NotBlank
@Pattern(regexp = "[1-9][0-9]*")
private String id;
// setter/getter
}
Mapping to
"id" Query Parameter
Constraint of
Bean Validation
jjug-mvc10/src/main/java/com/example/rest/form/EmployeeIdForm.java
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Send Object to View
25
public class EmployeeController {
@Inject private Models models;
@GET @Path("/result") @Controller
@ValidateOnExecution(type=ExecutableType.NONE)
public String result(…) {
models.put("employee", employee);
return "employee/result.html";
}
Box of Object
(Map + Iterator)
Object referred
by View
jjug-mvc10/src/main/java/com/example/rest/controller/EmployeeController.java
※Italic is feature of MVC
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Referring Object in View
26
<table th:unless="${employee == null}">
<tr th:object="${employee}">
<td th:text="*{empId}">99999</td>
<td th:text="*{name}">Taro Yamada</td>
<td th:text="*{joinedDate}">2020-01-01</td>
<td th:text="*{department.deptId}">99</td>
<td th:text="*{department.name}">Admin</td>
</tr>
</table> WEB-INF/views is view folder
jjug-mvc10/src/main/webapp/WEB-INF/views/employee/result.html
Name put to Models
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Validation
27
public class EmployeeController {
@Inject private BindingResult br;
@GET @Path("/result") @Controller
@ValidateOnExecution(type=ExecutableType.NONE)
public String result( @Valid @BeanParam
EmployeeIdForm form) {
if (br.isFailed()) {
models.put("bindingResult", br);
return "employee/index.html"; // To input view
Box of Messages
Enable
Validation
Error Processing
jjug-mvc10/src/main/java/com/example/rest/controller/EmployeeController.java
※Italic is feature of MVC
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Showing Error Messages
28
<ul th:if="${bindingResult != null}">
<li th:each="message
: ${bindingResult.allMessages}"
th:text="${message}">
This is Dummy Message
</li>
</ul>
Get Messages From
BindingResult
jjug-mvc10/src/main/webapp/WEB-INF/views/employee/index.html
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Writing Error Messages
! Write messages in 

src/main/resources/
ValidationMessages.properties
! Specify Key of Message to "message"
attribute in Annotation
29
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Specifying Error Message Key
30
public class EmployeeIdForm {
@QueryParam("id")
@NotBlank(message = "{id.notblank}")
@Pattern(regexp = "[1-9][0-9]*",
message = "{id.pattern}")
private String id;
// setter/getter
Key of Message with "{}"
jjug-mvc10/src/main/java/com/example/rest/form/EmployeeIdForm.java
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Caution :
MVC has No "Form-Binding" Feature
! @BeanParam is not "Form-Binding"
! On error, If You want to leave values in
input-components on view, Write view as
Next
31
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Implementing Form-Binding
32
<form action="./result" method="get">
<input type="text" name="id" value=""
th:value="${param.id == null} ? ''
: ${param.id[0]}"/>
<input type="submit" value="search"/>
</form>
jjug-mvc10/src/main/webapp/WEB-INF/views/employee/index.html
Maybe Complex with
selectbox …
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Handling Exception
! Implement ExceptionMapper interface
! When error occurs, ExceptionMapper
catches Exception
! You can implement multiple
ExceptionMappers
33
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
ExceptionMapper class
34
@Provider
public class ExceptionMapper implements
javax.ws.rs.ext.ExceptionMapper<Exception> {
public Response toResponse(
Exception exception) {
// Forward to Error View…
}
}
Don’t Forget @Provider
Catches Exception as
Method Argument
Implement
ExceptionMapper
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Other Features of MVC
! Security (XSS, CSRF)
! File Upload, Download
! MvcContext (Easy Specifying URL)
! Hybrid Class (HTML and REST)
! More Details, See GUGJ Slides below
! http://www.slideshare.net/masatoshitada7/java-ee-8mvc-10
35
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Conclusions of this chapter
! MVC 1.0 + Thymeleaf covers almost
features of Struts!
! Need to implement Transaction Token
and Form-Binding By Yourself
! Features of MVC are Simple, Reveraging
existing Java EE Features.
36
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
③Using Jersey MVC &
RESTEasy HTML in EE 7
37
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
What framework should we use
in Java EE 7?
! MVC 1.0 is Java EE 8
! Java EE 8 will be released in 2017 H1
38
Let’s use
Jersey MVC or RESTEasy HTML in EE7!
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
What’s Jersey MVC?
! Original Extension of Jersey(JAX-RS RI)
! Similar to MVC 1.0
! GlassFish/Payara inside
! WebLogic not inside
39
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
What’s RESTEasy HTML?
! Original Extension of RESTEasy (other
implementation of JAX-RS)
! RESTEasy is inside WildFly/JBoss,

but RESTEasy HTML is not inside
40
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Basic Jersey MVC
! Register MvcFeature class to Your Application
sub class (ResourceConfig is Convinient)
41
@ApplicationPath("/api")
public class MyApplication extends ResourceConfig {
public MyApplication() {
register(MvcFeature.class);
property(MvcFeature.TEMPLATE_BASE_PATH,
"/WEB-INF/views/");
packages(true, "com.example.rest");
}
} jjug-jersey-mvc/src/main/java/com/example/rest/MyApplication.java
※Italic is Jersey MVC’s feature
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Basic Jersey MVC
! Return Viewable in controller methods
42
@Path("/employee")
public class EmployeeController {
@GET @Path("/index")
public ThymeleafViewable index(…) {
return new ThymeleafViewable(
"employee/index.html");
}
}
My original class
(Viewable’s subclass)
jjug-jersey-mvc/src/main/java/com/example/rest/controller/EmployeeControler.java
※Italic is Jersey MVC’s feature
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Basic Jersey MVC
! Add value to Viewable constructor’s 2nd
parameter
43
@Path("/employee")
public class EmployeeController {
@GET @Path("/result")
public ThymeleafViewable result(…) {
Map<String, Object> models = …
return new ThymeleafViewable(
"employee/result.html", models);
}
Put objects to Map
jjug-jersey-mvc/src/main/java/com/example/rest/controller/EmployeeControler.java
※Italic is Jersey MVC’s feature
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
How to Use Thymeleaf
with Jersey MVC
! Implment TemplateProcessor interface
(Provided by Jersey)
! AbstractTemplateProcessor class is
useful
! implementation of TemplateProcessor
44
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
ThymeleafTemplateProcessor
45
@Provider
public class ThymeleafTemplateProcessor
extends AbstractTemplateProcessor<String> {
private TemplateEngine templateEngine;
@Inject public ThymeleafTemplateProcessor(
Configuration config, ServletContext servletContext) {
super(config, servletContext, "html", "html");
TemplateResolver templateResolver =
new ServletContextTemplateResolver();
templateResolver.setPrefix((String) config.getProperty(
MvcFeature.TEMPLATE_BASE_PATH));
templateEngine = new TemplateEngine();
templateEngine.setTemplateResolver(templateResolver);
}
// to next slide
jjug-jersey-mvc/src/main/java/com/example/rest
/thymeleaf/ThymeleafTemplateProcessor.java
※Italic is Jersey MVC’s feature
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
ThymeleafTemplateProcessor
46
// 続き
@Override public void writeTo(...) {
WebContext webContext = new WebContext(
request, response, servletContext, request.getLocale());
Map<String, Object> map = (Map) viewable.getModel();
webContext.setVariables(map);
templateEngine.process(viewable.getTemplateName(),
webContext, response.getWriter());
}
}
jjug-jersey-mvc/src/main/java/com/example/rest
/thymeleaf/ThymeleafTemplateProcessor.java
Thymeleaf write
the response
※Italic is Jersey MVC’s feature
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Validation in Jersey MVC
! Jersey provides @ErrorTemplate annotation
to specify error view, but…
! This annotation is feature for handling
exception (not for validation)
! MVC 1.0 doesn’t have similar feature, so
migration will be difficult
! Cannot use "Validation Group" and "Group
Sequence" (Features of Bean Validation)
47
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Validate in Controller Methods
48
@Inject Validator validator;
@GET @Path("/result")
public ThymeleafViewable result(
@BeanParam EmployeeIdForm form) {
Set<ConstraintViolation<EmployeeIdForm>>
violations = validator.validate(form);
if (!violations.isEmpty()) {
Map<String, Object> model = …;
model.put("violations", violations);
return new ThymeleafViewable(
"employee/index.html", model);
}
Execute Bean Validation
No @Valid to arguments
Validate
On error,
return to
input view
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Showing Error Message
49
<ul th:if="${violations != null}">
<li th:each="violation : ${violations}"
th:text="${violation.message}">
This is Dummy Message
</li>
</ul>
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
About This Method
! Advantage
! Pure JAX-RS code
! Easy MVC 1.0 migration
! Avoid excess framework customization
! Disadvantage
! It takes time and effort
50
I Tried a variety of methods,
this method is best
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Handling Exception
! ExceptionMapper
! Same to MVC 1.0 sample code
51
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Redirect
! JAX-RSのコードで書けばOK
52
@GET @Path("/redirect")
public Response redirect(
@Context UriInfo uriInfo) throws Exception {
URI location = uriInfo.getBaseUriBuilder()
.path(HelloResource.class)
.path("redirect2")
.build();
return Response.status(Response.Status.FOUND)
.location(location).build();
}
UriInfo has variety of
method to build URI
Specify URI to Location header
Status code 3xx
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Basic RESTEasy HTML
! Create Application’s sub class
! No need to register any specific class
! By JAX-RS "Providers"
53
@ApplicationPath("/api")
public class MyApplication extends Application {
}
jjug-resteasy-html/src/main/java/com/example/rest/MyApplication.java
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Basic RESTEasy HTML
! Return Renderable in controller method
54
<<interface>>
Renderable
View class
(Forward)
Redirect class
(Redirect)
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Using Thymeleaf in RESTEasy HTML
! Create Renderable implementation class
55
<<interface>>
Renderable
View Redirect ThymeleafView
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
ThymeleafView
56
public class ThymeleafView implements Renderable {
private String templateName;
private Map<String, Object> models;
private TemplateEngine templateEngine;
public ThymeleafView(String templateName) {
this(templateName, new HashMap<>());
}
public ThymeleafView(String templateName,
Map<String, Object> models) {
this.templateName = templateName;
this.models = models;
}
void setTemplateEngine(TemplateEngine templateEngine) {
this.templateEngine = templateEngine;
}
Implement
Renderable
※Italic is RESTEasy HTML feature
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
ThymeleafView
57
// from previous slide
@Override
public void render(HttpServletRequest request,
HttpServletResponse response) throws IOException,
ServletException, WebApplicationException {
response.setCharacterEncoding("UTF-8");
WebContext webContext = new WebContext(
request, response, request.getServletContext(),
request.getLocale());
webContext.setVariables(models);
templateEngine.process(templateName, webContext,
response.getWriter());
}
}
Call TemplateEngine#process() in render()
※Italic is RESTEasy HTML feature
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Creating Interceptor
Setting TemplateEngine to ThymeleafView
! Use JAX-RS WriterInterceptor
! Create custom annotation with
NameBinding, to specify which
controller apply interceptor
! There’re many ways(This is not only
way)
58
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Creating annotation
59
@NameBinding
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD,
ElementType.TYPE})
@Documented
public @interface ThymeleafController {
}
Create annotation
with @NameBinding
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Creating WriterInterceptor
60
@Provider
@ThymeleafController
public class ThymeleafWriterInterceptor
implements WriterInterceptor {
private TemplateEngine templateEngine;
@PostConstruct
public void init() {
TemplateResolver resolver =
new ServletContextTemplateResolver();
resolver.setPrefix("/WEB-INF/views/");
templateEngine = new TemplateEngine();
templateEngine.setTemplateResolver(resolver);
}
Specify annotation you created
Implement WriterInterceptor
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Creating WriterInterceptor
61
@Override
public void aroundWriteTo(WriterInterceptorContext context)
throws IOException, WebApplicationException {
Object entity = context.getEntity();
if (ThymeleafView.class.isAssignableFrom(entity.getClass())) {
ThymeleafView thymeleafView =
(ThymeleafView) context.getEntity();
thymeleafView.setTemplateEngine(templateEngine);
}
context.proceed();
}
}
Set TemplateEngine
before context.proceed()
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Controller
62
@GET @Path("result")
@ThymeleafController
public ThymeleafView result(…) {
Map<String, Object> models = …;
models.put("employee", employee);
return new ThymeleafView(
"employee/result.html", models);
}
Specify annotation
→Applying interceptor
View path and values
※Italic is RESTEasy HTML feature
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Validation and Handling Exception
! Same as Jersey MVC sample code
63
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Conclusions of this chapter
! In Java EE 7, 

Use Jersey MVC or RESTEasy HTML!
! Controller methods, views and handling
exceptions are same as MVC 1.0!
! They have no BindingResult, so validate
in controller methods!
64
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
④Other Java EE
Technologies
You Should Know
65
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
JAX-RS
! Specific features of MVC 1.0/Jersey MVC/
RESTEasy HTML are not many
! To achieve what you want to do, and
trouble-shooting, knowledge of JAX-RS is
very important
66
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
JAX-RS Reference
! JSR-339 JAX-RS 2.0 rev.A
! You should learn Processing Pipeline

(Appendix C)
! https://jcp.org/en/jsr/detail?id=339
! Jersey Document
! RESTEasy Document
67
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Others
! Bean Validation
! CDI
! JPA
68
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
⑤Final Conclusions
69
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Final Conclusions
! MVC 1.0 + Thymeleaf covers almost
features of Struts!
! In EE 7, Use Jersey MVC or RESTEasy
HTML!
! Understanding JAX-RS is very important!
70
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Caution
! Jersey MVC and RESTEasy HTML are 

NOT "Java EE 7 standard"
! They will be out of range 

of server vendors’ support
! In "Java EE 7 standard", 

JSF is the ONLY HTML Framework
71
#ccc_cd4
(C) CASAREAL, Inc. All rights reserved.
Enjoy Java EE!!
! Thank you!
72

More Related Content

What's hot

Mavenの真実とウソ
Mavenの真実とウソMavenの真実とウソ
Mavenの真実とウソ
Yoshitaka Kawashima
 
はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)
Masatoshi Tada
 
JVMのGCアルゴリズムとチューニング
JVMのGCアルゴリズムとチューニングJVMのGCアルゴリズムとチューニング
JVMのGCアルゴリズムとチューニング
佑哉 廣岡
 
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_cccPivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
Masatoshi Tada
 
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。 【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
日本マイクロソフト株式会社
 
Serverless時代のJavaについて
Serverless時代のJavaについてServerless時代のJavaについて
Serverless時代のJavaについて
Amazon Web Services Japan
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
Derek Willian Stavis
 
マルチテナントのアプリケーション実装〜実践編〜
マルチテナントのアプリケーション実装〜実践編〜マルチテナントのアプリケーション実装〜実践編〜
マルチテナントのアプリケーション実装〜実践編〜
Yoshiki Nakagawa
 
UIbuilderを使ったフロントエンド開発
UIbuilderを使ったフロントエンド開発UIbuilderを使ったフロントエンド開発
UIbuilderを使ったフロントエンド開発
Atsushi Kojo
 
Javaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組みJavaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組み
Chihiro Ito
 
Java ORマッパー選定のポイント #jsug
Java ORマッパー選定のポイント #jsugJava ORマッパー選定のポイント #jsug
Java ORマッパー選定のポイント #jsug
Masatoshi Tada
 
Java EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行についてJava EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行について
Shigeru Tatsuta
 
例外設計における大罪
例外設計における大罪例外設計における大罪
例外設計における大罪
Takuto Wada
 
SPAセキュリティ入門~PHP Conference Japan 2021
SPAセキュリティ入門~PHP Conference Japan 2021SPAセキュリティ入門~PHP Conference Japan 2021
SPAセキュリティ入門~PHP Conference Japan 2021
Hiroshi Tokumaru
 
メンバーのスキルアップ、どうしてる? − Java 100本ノックで新加入メンバーを鍛えてみた −
メンバーのスキルアップ、どうしてる? − Java 100本ノックで新加入メンバーを鍛えてみた −メンバーのスキルアップ、どうしてる? − Java 100本ノックで新加入メンバーを鍛えてみた −
メンバーのスキルアップ、どうしてる? − Java 100本ノックで新加入メンバーを鍛えてみた −
JustSystems Corporation
 
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web ServiceアプリケーションAngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
ssuser070fa9
 
マイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチマイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチ
増田 亨
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
Amazon Web Services Japan
 
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Matt Raible
 
SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the Things
Scott Gardner
 

What's hot (20)

Mavenの真実とウソ
Mavenの真実とウソMavenの真実とウソ
Mavenの真実とウソ
 
はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)はまる!JPA(初学者向けライト版)
はまる!JPA(初学者向けライト版)
 
JVMのGCアルゴリズムとチューニング
JVMのGCアルゴリズムとチューニングJVMのGCアルゴリズムとチューニング
JVMのGCアルゴリズムとチューニング
 
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_cccPivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
Pivotal認定講師によるSpring Framework 5.1 & Spring Boot 2.1ハンズオン! #jjug_ccc
 
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。 【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
【BS4】時は来たれり。今こそ .NET 6 へ移行する時。
 
Serverless時代のJavaについて
Serverless時代のJavaについてServerless時代のJavaについて
Serverless時代のJavaについて
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
 
マルチテナントのアプリケーション実装〜実践編〜
マルチテナントのアプリケーション実装〜実践編〜マルチテナントのアプリケーション実装〜実践編〜
マルチテナントのアプリケーション実装〜実践編〜
 
UIbuilderを使ったフロントエンド開発
UIbuilderを使ったフロントエンド開発UIbuilderを使ったフロントエンド開発
UIbuilderを使ったフロントエンド開発
 
Javaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組みJavaはどのように動くのか~スライドでわかるJVMの仕組み
Javaはどのように動くのか~スライドでわかるJVMの仕組み
 
Java ORマッパー選定のポイント #jsug
Java ORマッパー選定のポイント #jsugJava ORマッパー選定のポイント #jsug
Java ORマッパー選定のポイント #jsug
 
Java EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行についてJava EE から Quarkus による開発への移行について
Java EE から Quarkus による開発への移行について
 
例外設計における大罪
例外設計における大罪例外設計における大罪
例外設計における大罪
 
SPAセキュリティ入門~PHP Conference Japan 2021
SPAセキュリティ入門~PHP Conference Japan 2021SPAセキュリティ入門~PHP Conference Japan 2021
SPAセキュリティ入門~PHP Conference Japan 2021
 
メンバーのスキルアップ、どうしてる? − Java 100本ノックで新加入メンバーを鍛えてみた −
メンバーのスキルアップ、どうしてる? − Java 100本ノックで新加入メンバーを鍛えてみた −メンバーのスキルアップ、どうしてる? − Java 100本ノックで新加入メンバーを鍛えてみた −
メンバーのスキルアップ、どうしてる? − Java 100本ノックで新加入メンバーを鍛えてみた −
 
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web ServiceアプリケーションAngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
AngularとSpring Bootで作るSPA + RESTful Web Serviceアプリケーション
 
マイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチマイクロサービス 4つの分割アプローチ
マイクロサービス 4つの分割アプローチ
 
マルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのことマルチテナント化で知っておきたいデータベースのこと
マルチテナント化で知っておきたいデータベースのこと
 
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
Reactive Java Microservices with Spring Boot and JHipster - Spring I/O 2022
 
SwiftUI and Combine All the Things
SwiftUI and Combine All the ThingsSwiftUI and Combine All the Things
SwiftUI and Combine All the Things
 

Viewers also liked

Spring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjugSpring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjug
Masatoshi Tada
 
Java EEハンズオン資料 JJUG CCC 2015 Fall
Java EEハンズオン資料 JJUG CCC 2015 FallJava EEハンズオン資料 JJUG CCC 2015 Fall
Java EEハンズオン資料 JJUG CCC 2015 Fall
Masatoshi Tada
 
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Kohei Saito
 
Java SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心にJava SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心に
Taku Miyakawa
 
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_cccJPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_cccMasatoshi Tada
 
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho ltNetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
Masatoshi Tada
 
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
Masatoshi Tada
 
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2Masatoshi Tada
 
Multibranch pipelineでいろいろ学んだこと
Multibranch pipelineでいろいろ学んだことMultibranch pipelineでいろいろ学んだこと
Multibranch pipelineでいろいろ学んだこと
aha_oretama
 
マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方
CData Software Japan
 
日本 Java ユーザーグループ JJUG CCC 2015 Fall by ソラコム 片山
日本 Java ユーザーグループ JJUG CCC 2015 Fall  by ソラコム 片山 日本 Java ユーザーグループ JJUG CCC 2015 Fall  by ソラコム 片山
日本 Java ユーザーグループ JJUG CCC 2015 Fall by ソラコム 片山
SORACOM,INC
 
Java8 Stream APIとApache SparkとAsakusa Frameworkの類似点・相違点
Java8 Stream APIとApache SparkとAsakusa Frameworkの類似点・相違点Java8 Stream APIとApache SparkとAsakusa Frameworkの類似点・相違点
Java8 Stream APIとApache SparkとAsakusa Frameworkの類似点・相違点
hishidama
 
Javaにおけるネイティブコード連携の各種手法の紹介
Javaにおけるネイティブコード連携の各種手法の紹介Javaにおけるネイティブコード連携の各種手法の紹介
Javaにおけるネイティブコード連携の各種手法の紹介
khisano
 
プログラム初心者がWebサービスをリリースして運営するまで
プログラム初心者がWebサービスをリリースして運営するまでプログラム初心者がWebサービスをリリースして運営するまで
プログラム初心者がWebサービスをリリースして運営するまで
Tomoaki Iwasaki
 
【こっそり始める】Javaプログラマコーディングマイグレーション
【こっそり始める】Javaプログラマコーディングマイグレーション【こっそり始める】Javaプログラマコーディングマイグレーション
【こっそり始める】Javaプログラマコーディングマイグレーション
yy yank
 
よくある業務開発の自動化事情 #jjug_ccc #ccc_cd3
よくある業務開発の自動化事情 #jjug_ccc #ccc_cd3よくある業務開発の自動化事情 #jjug_ccc #ccc_cd3
よくある業務開発の自動化事情 #jjug_ccc #ccc_cd3
irof N
 
Real world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.comReal world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.com
Mathieu Dumoulin
 
Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)
Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)
Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)
sogdice
 
デバッガのしくみ(JDI)を学んでみよう
デバッガのしくみ(JDI)を学んでみようデバッガのしくみ(JDI)を学んでみよう
デバッガのしくみ(JDI)を学んでみよう
fukai_yas
 
Reactive Webアプリケーション - そしてSpring 5へ #jjug_ccc #ccc_ef3
Reactive Webアプリケーション - そしてSpring 5へ #jjug_ccc #ccc_ef3Reactive Webアプリケーション - そしてSpring 5へ #jjug_ccc #ccc_ef3
Reactive Webアプリケーション - そしてSpring 5へ #jjug_ccc #ccc_ef3
Toshiaki Maki
 

Viewers also liked (20)

Spring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjugSpring Bootの本当の理解ポイント #jjug
Spring Bootの本当の理解ポイント #jjug
 
Java EEハンズオン資料 JJUG CCC 2015 Fall
Java EEハンズオン資料 JJUG CCC 2015 FallJava EEハンズオン資料 JJUG CCC 2015 Fall
Java EEハンズオン資料 JJUG CCC 2015 Fall
 
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
Dockerで始める Java EE アプリケーション開発 for JJUG CCC 2017
 
Java SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心にJava SE 9の紹介: モジュール・システムを中心に
Java SE 9の紹介: モジュール・システムを中心に
 
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_cccJPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
JPAの同時実行制御とロック20140518 #ccc_r15 #jjug_ccc
 
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho ltNetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
NetBeansでかんたんJava EE ○分間クッキング! #kuwaccho lt
 
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
Java EE 8先取り!MVC 1.0入門 [EDR2対応版] 2015-10-10更新
 
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
ステップ・バイ・ステップで学ぶラムダ式・Stream api入門 #jjug ccc #ccc h2
 
Multibranch pipelineでいろいろ学んだこと
Multibranch pipelineでいろいろ学んだことMultibranch pipelineでいろいろ学んだこと
Multibranch pipelineでいろいろ学んだこと
 
マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方マルチクラウドデータ連携Javaアプリケーションの作り方
マルチクラウドデータ連携Javaアプリケーションの作り方
 
日本 Java ユーザーグループ JJUG CCC 2015 Fall by ソラコム 片山
日本 Java ユーザーグループ JJUG CCC 2015 Fall  by ソラコム 片山 日本 Java ユーザーグループ JJUG CCC 2015 Fall  by ソラコム 片山
日本 Java ユーザーグループ JJUG CCC 2015 Fall by ソラコム 片山
 
Java8 Stream APIとApache SparkとAsakusa Frameworkの類似点・相違点
Java8 Stream APIとApache SparkとAsakusa Frameworkの類似点・相違点Java8 Stream APIとApache SparkとAsakusa Frameworkの類似点・相違点
Java8 Stream APIとApache SparkとAsakusa Frameworkの類似点・相違点
 
Javaにおけるネイティブコード連携の各種手法の紹介
Javaにおけるネイティブコード連携の各種手法の紹介Javaにおけるネイティブコード連携の各種手法の紹介
Javaにおけるネイティブコード連携の各種手法の紹介
 
プログラム初心者がWebサービスをリリースして運営するまで
プログラム初心者がWebサービスをリリースして運営するまでプログラム初心者がWebサービスをリリースして運営するまで
プログラム初心者がWebサービスをリリースして運営するまで
 
【こっそり始める】Javaプログラマコーディングマイグレーション
【こっそり始める】Javaプログラマコーディングマイグレーション【こっそり始める】Javaプログラマコーディングマイグレーション
【こっそり始める】Javaプログラマコーディングマイグレーション
 
よくある業務開発の自動化事情 #jjug_ccc #ccc_cd3
よくある業務開発の自動化事情 #jjug_ccc #ccc_cd3よくある業務開発の自動化事情 #jjug_ccc #ccc_cd3
よくある業務開発の自動化事情 #jjug_ccc #ccc_cd3
 
Real world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.comReal world machine learning with Java for Fumankaitori.com
Real world machine learning with Java for Fumankaitori.com
 
Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)
Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)
Java8移行から始めた技術的負債との戦い(jjug ccc 2015 fall)
 
デバッガのしくみ(JDI)を学んでみよう
デバッガのしくみ(JDI)を学んでみようデバッガのしくみ(JDI)を学んでみよう
デバッガのしくみ(JDI)を学んでみよう
 
Reactive Webアプリケーション - そしてSpring 5へ #jjug_ccc #ccc_ef3
Reactive Webアプリケーション - そしてSpring 5へ #jjug_ccc #ccc_ef3Reactive Webアプリケーション - そしてSpring 5へ #jjug_ccc #ccc_ef3
Reactive Webアプリケーション - そしてSpring 5へ #jjug_ccc #ccc_ef3
 

Similar to Getting start Java EE Action-Based MVC with Thymeleaf

Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
Stefano Paluello
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET Webskills
Caleb Jenkins
 
ASP .Net MVC 5
ASP .Net MVC 5ASP .Net MVC 5
ASP .Net MVC 5
Nilachal sethi
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
Hendrik Ebbers
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers Make
Mark Meyer
 
Spring MVC Intro / Gore - Nov NHJUG
Spring MVC Intro / Gore - Nov NHJUGSpring MVC Intro / Gore - Nov NHJUG
Spring MVC Intro / Gore - Nov NHJUG
Ted Pennings
 
Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2
Joe Wilson
 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)
Massimo Oliviero
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
hchen1
 
.NET Coding Standards For The Real World (2012)
.NET Coding Standards For The Real World (2012).NET Coding Standards For The Real World (2012)
.NET Coding Standards For The Real World (2012)
David McCarter
 
Session - 1 Forms and Session management.pptx
Session - 1 Forms and Session management.pptxSession - 1 Forms and Session management.pptx
Session - 1 Forms and Session management.pptx
imjdabhinawpandey
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
Antônio Roberto Silva
 
AngularJS for Web and Mobile
 AngularJS for Web and Mobile AngularJS for Web and Mobile
AngularJS for Web and Mobile
Rocket Software
 
Dsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in ScalaDsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in Scala
Ugo Matrangolo
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
Amzad Hossain
 
AWS Summit DC 2021: Improve the developer experience with AWS CDK
AWS Summit DC 2021: Improve the developer experience with AWS CDKAWS Summit DC 2021: Improve the developer experience with AWS CDK
AWS Summit DC 2021: Improve the developer experience with AWS CDK
Casey Lee
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
joselinoneto
 
It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016
Przemek Jakubczyk
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
Phuc Le Cong
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Fwdays
 

Similar to Getting start Java EE Action-Based MVC with Thymeleaf (20)

Asp.Net MVC Intro
Asp.Net MVC IntroAsp.Net MVC Intro
Asp.Net MVC Intro
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET Webskills
 
ASP .Net MVC 5
ASP .Net MVC 5ASP .Net MVC 5
ASP .Net MVC 5
 
JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)JavaFX Enterprise (JavaOne 2014)
JavaFX Enterprise (JavaOne 2014)
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers Make
 
Spring MVC Intro / Gore - Nov NHJUG
Spring MVC Intro / Gore - Nov NHJUGSpring MVC Intro / Gore - Nov NHJUG
Spring MVC Intro / Gore - Nov NHJUG
 
Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2Introduction to ASP.NET MVC 2
Introduction to ASP.NET MVC 2
 
Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)Advanced iOS Debbuging (Reloaded)
Advanced iOS Debbuging (Reloaded)
 
Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
.NET Coding Standards For The Real World (2012)
.NET Coding Standards For The Real World (2012).NET Coding Standards For The Real World (2012)
.NET Coding Standards For The Real World (2012)
 
Session - 1 Forms and Session management.pptx
Session - 1 Forms and Session management.pptxSession - 1 Forms and Session management.pptx
Session - 1 Forms and Session management.pptx
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 
AngularJS for Web and Mobile
 AngularJS for Web and Mobile AngularJS for Web and Mobile
AngularJS for Web and Mobile
 
Dsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in ScalaDsug 05 02-15 - ScalDI - lightweight DI in Scala
Dsug 05 02-15 - ScalDI - lightweight DI in Scala
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
AWS Summit DC 2021: Improve the developer experience with AWS CDK
AWS Summit DC 2021: Improve the developer experience with AWS CDKAWS Summit DC 2021: Improve the developer experience with AWS CDK
AWS Summit DC 2021: Improve the developer experience with AWS CDK
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
 
It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016It's always your fault. Poznań ADG 2016
It's always your fault. Poznań ADG 2016
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
 

More from Masatoshi Tada

これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetupこれで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
Masatoshi Tada
 
基礎からのOAuth 2.0とSpring Security 5.1による実装
基礎からのOAuth 2.0とSpring Security 5.1による実装基礎からのOAuth 2.0とSpring Security 5.1による実装
基礎からのOAuth 2.0とSpring Security 5.1による実装
Masatoshi Tada
 
初めてでも30分で分かるSpring 5 & Spring Boot 2オーバービュー
初めてでも30分で分かるSpring 5 & Spring Boot 2オーバービュー初めてでも30分で分かるSpring 5 & Spring Boot 2オーバービュー
初めてでも30分で分かるSpring 5 & Spring Boot 2オーバービュー
Masatoshi Tada
 
ReactiveだけじゃないSpring 5 & Spring Boot 2新機能解説
ReactiveだけじゃないSpring 5 & Spring Boot 2新機能解説ReactiveだけじゃないSpring 5 & Spring Boot 2新機能解説
ReactiveだけじゃないSpring 5 & Spring Boot 2新機能解説
Masatoshi Tada
 
Java EE 8新機能解説 -Bean Validation 2.0編-
Java EE 8新機能解説 -Bean Validation 2.0編-Java EE 8新機能解説 -Bean Validation 2.0編-
Java EE 8新機能解説 -Bean Validation 2.0編-
Masatoshi Tada
 
JSUG SpringOne 2017報告会
JSUG SpringOne 2017報告会JSUG SpringOne 2017報告会
JSUG SpringOne 2017報告会
Masatoshi Tada
 
とにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みるとにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みる
Masatoshi Tada
 
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
Masatoshi Tada
 
Spring Data JPAによるデータアクセス徹底入門 #jsug
Spring Data JPAによるデータアクセス徹底入門 #jsugSpring Data JPAによるデータアクセス徹底入門 #jsug
Spring Data JPAによるデータアクセス徹底入門 #jsug
Masatoshi Tada
 

More from Masatoshi Tada (9)

これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetupこれで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
これで怖くない!?コードリーディングで学ぶSpring Security #中央線Meetup
 
基礎からのOAuth 2.0とSpring Security 5.1による実装
基礎からのOAuth 2.0とSpring Security 5.1による実装基礎からのOAuth 2.0とSpring Security 5.1による実装
基礎からのOAuth 2.0とSpring Security 5.1による実装
 
初めてでも30分で分かるSpring 5 & Spring Boot 2オーバービュー
初めてでも30分で分かるSpring 5 & Spring Boot 2オーバービュー初めてでも30分で分かるSpring 5 & Spring Boot 2オーバービュー
初めてでも30分で分かるSpring 5 & Spring Boot 2オーバービュー
 
ReactiveだけじゃないSpring 5 & Spring Boot 2新機能解説
ReactiveだけじゃないSpring 5 & Spring Boot 2新機能解説ReactiveだけじゃないSpring 5 & Spring Boot 2新機能解説
ReactiveだけじゃないSpring 5 & Spring Boot 2新機能解説
 
Java EE 8新機能解説 -Bean Validation 2.0編-
Java EE 8新機能解説 -Bean Validation 2.0編-Java EE 8新機能解説 -Bean Validation 2.0編-
Java EE 8新機能解説 -Bean Validation 2.0編-
 
JSUG SpringOne 2017報告会
JSUG SpringOne 2017報告会JSUG SpringOne 2017報告会
JSUG SpringOne 2017報告会
 
とにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みるとにかく分かりづらいTwelve-Factor Appの解説を試みる
とにかく分かりづらいTwelve-Factor Appの解説を試みる
 
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
Java EEでもOAuth 2.0!~そしてPayara Micro on Cloud Foundryで遊ぶ~
 
Spring Data JPAによるデータアクセス徹底入門 #jsug
Spring Data JPAによるデータアクセス徹底入門 #jsugSpring Data JPAによるデータアクセス徹底入門 #jsug
Spring Data JPAによるデータアクセス徹底入門 #jsug
 

Recently uploaded

Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
Jason Packer
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 

Recently uploaded (20)

Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024Columbus Data & Analytics Wednesdays - June 2024
Columbus Data & Analytics Wednesdays - June 2024
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 

Getting start Java EE Action-Based MVC with Thymeleaf

  • 1. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Getting Start Java EE Action-Based MVC With Thymeleaf Masatoshi Tada (Casareal ,Inc) JJUG CCC 2016 Spring 2016-5-21(Sat) 1
  • 2. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. About This Session ! Answer Your Question "Java EE is Useful Framework As Next Struts?" ! View is Thymeleaf ! ! Code on GitHub ! https://github.com/MasatoshiTada/jjug-action-based- mvc ! Sorry, comments are written in Japanese 2
  • 3. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. About Me ! Masatoshi Tada !Casareal, Inc !GlassFish User Group Japan !Trainer(Java EE/Spring/Swift) !Twitter:@suke_masa 3
  • 4. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Agenda ① What’s "Action-Based MVC"? ② Getting Start MVC 1.0(EE 8) ③ Using Jersey MVC & RESTEasy HTML in EE 7 ④ Other Java EE Technologies You Should Know ⑤ Final Conclusions 4
  • 5. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ①What’s "Action-Based MVC"? 5
  • 6. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. What’s Action-Based MVC? ! Web Framework which focuses HTTP request & response ! Most of framework are Action-Based ! Struts, Spring MVC, … 6
  • 7. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. What’s Action-Based MVC? 7 View View Controller Model request response Struts developer friendly
  • 8. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. What’s "Component-Based MVC"? 8 View Backing Bean Model GUI(VB, Android…) developer friendly -> Struts developer Un-Friendly
  • 9. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Web Framework of Java EE ! JSF ! Responses HTML ! Component-Based ! JAX-RS ! Responses JSON/XML ! Action-Based 9 There’s no Framework which is "Action-Based" and "Responses HTML"
  • 10. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Java EE Standard Action-Based MVC!! ! Model-View-Controller API (MVC 1.0) ! Java EE 8 (2017 H1) ! Based on JAX-RS 10
  • 11. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ②Getting Start MVC 1.0 11
  • 12. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. MVC 1.0 ! MVC 1.0 is Specification ! ≒Set of Interfaces, Annotations, and Exceptions ! Reference Implementation is Ozark ! Set of Implementation Classes of above interfaces 12
  • 13. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Main Functions of Struts ! Controller ! Validation ! Handling Exception ! View Technology ! Transaction Token 13
  • 14. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. in MVC 1.0? ! Controller → ⭕ ! Validation → ⭕ ! Handling Exception → ⭕ ! View Technology → ❌ ! Transaction Token → ❌ 14
  • 15. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Why No View Technologies in MVC? ! Non-Goal 1 of MVC specification
 "Define a new view (template) language and processor." ! Instead, MVC provides integration with many view technologies! 15
  • 16. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. View Technologies We Can Use in MVC 1.0 ! MVC ! JSP, Facelets ! Ozark ! Thymeleaf, Mustache, Freemarker,
 Handlerbars, Velocity, AsciiDoc, … 16 If you want to use other View, Implement ViewEngine interface
  • 17. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Problems of JSP and Facelets 17 ! JSP ! Mix of Logic and View ! Sometime Occurs XSS ! Facelets ! Cannot Use All Features in MVC 1.0 ! Bad Compatibility with JavaScript
  • 18. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Let’s Use Thymeleaf! 18 ! Pure HTML! ! Isolate View and Logic absolutely! ! Good Compatibility with JavaScript! ! Link Expression is very useful! ! Internationalizing message! ! http://www.thymeleaf.org/doc/tutorials/2.1/ usingthymeleaf.html#a-multi-language-welcome
  • 19. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Using Thymeleaf in MVC 1.0 19 <dependency> <groupId>org.glassfish.ozark.ext</groupId> <artifactId>ozark-thymeleaf</artifactId> <version>1.0.0-m02</version> <scope>compile</scope> </dependency> ! Just adding dependency like below
  • 20. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Why No Transaction Token Feature? ! In Expert Group’s Mailing-List, 
 "This is a client side concern" ! https://java.net/projects/mvc-spec/lists/ jsr371-experts/archive/2015-07/message/2 ! Spring MVC has no transaction token feature, too. 20
  • 21. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. How to Avoid Double-Submit-Problem ! See TERASOLUNA Guideline ! http://terasolunaorg.github.io/guideline/ 5.1.0.RELEASE/en/ArchitectureInDetail/ DoubleSubmitProtection.html 21
  • 22. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Preparation : Enabling JAX-RS 22 @ApplicationPath("/api") public class MyApplication extends Application { } Inherit Application class Add Annotation jjug-mvc10/src/main/java/com/example/rest/MyApllication.java
  • 23. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Basic Controller 23 @Path("/employee") public class EmployeeController { @GET @Path("/index") @Controller public String index() { return "employee/index.html"; } } Path of View (extention is REQUIRED) Indicate as controller method Mapping to URL & HTTP method ※Italic is feature of MVC jjug-mvc10/src/main/java/com/example/rest/controller/EmployeeController.java
  • 24. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Form Class 24 public class EmployeeIdForm { @QueryParam("id") @NotBlank @Pattern(regexp = "[1-9][0-9]*") private String id; // setter/getter } Mapping to "id" Query Parameter Constraint of Bean Validation jjug-mvc10/src/main/java/com/example/rest/form/EmployeeIdForm.java
  • 25. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Send Object to View 25 public class EmployeeController { @Inject private Models models; @GET @Path("/result") @Controller @ValidateOnExecution(type=ExecutableType.NONE) public String result(…) { models.put("employee", employee); return "employee/result.html"; } Box of Object (Map + Iterator) Object referred by View jjug-mvc10/src/main/java/com/example/rest/controller/EmployeeController.java ※Italic is feature of MVC
  • 26. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Referring Object in View 26 <table th:unless="${employee == null}"> <tr th:object="${employee}"> <td th:text="*{empId}">99999</td> <td th:text="*{name}">Taro Yamada</td> <td th:text="*{joinedDate}">2020-01-01</td> <td th:text="*{department.deptId}">99</td> <td th:text="*{department.name}">Admin</td> </tr> </table> WEB-INF/views is view folder jjug-mvc10/src/main/webapp/WEB-INF/views/employee/result.html Name put to Models
  • 27. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Validation 27 public class EmployeeController { @Inject private BindingResult br; @GET @Path("/result") @Controller @ValidateOnExecution(type=ExecutableType.NONE) public String result( @Valid @BeanParam EmployeeIdForm form) { if (br.isFailed()) { models.put("bindingResult", br); return "employee/index.html"; // To input view Box of Messages Enable Validation Error Processing jjug-mvc10/src/main/java/com/example/rest/controller/EmployeeController.java ※Italic is feature of MVC
  • 28. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Showing Error Messages 28 <ul th:if="${bindingResult != null}"> <li th:each="message : ${bindingResult.allMessages}" th:text="${message}"> This is Dummy Message </li> </ul> Get Messages From BindingResult jjug-mvc10/src/main/webapp/WEB-INF/views/employee/index.html
  • 29. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Writing Error Messages ! Write messages in 
 src/main/resources/ ValidationMessages.properties ! Specify Key of Message to "message" attribute in Annotation 29
  • 30. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Specifying Error Message Key 30 public class EmployeeIdForm { @QueryParam("id") @NotBlank(message = "{id.notblank}") @Pattern(regexp = "[1-9][0-9]*", message = "{id.pattern}") private String id; // setter/getter Key of Message with "{}" jjug-mvc10/src/main/java/com/example/rest/form/EmployeeIdForm.java
  • 31. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Caution : MVC has No "Form-Binding" Feature ! @BeanParam is not "Form-Binding" ! On error, If You want to leave values in input-components on view, Write view as Next 31
  • 32. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Implementing Form-Binding 32 <form action="./result" method="get"> <input type="text" name="id" value="" th:value="${param.id == null} ? '' : ${param.id[0]}"/> <input type="submit" value="search"/> </form> jjug-mvc10/src/main/webapp/WEB-INF/views/employee/index.html Maybe Complex with selectbox …
  • 33. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Handling Exception ! Implement ExceptionMapper interface ! When error occurs, ExceptionMapper catches Exception ! You can implement multiple ExceptionMappers 33
  • 34. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ExceptionMapper class 34 @Provider public class ExceptionMapper implements javax.ws.rs.ext.ExceptionMapper<Exception> { public Response toResponse( Exception exception) { // Forward to Error View… } } Don’t Forget @Provider Catches Exception as Method Argument Implement ExceptionMapper
  • 35. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Other Features of MVC ! Security (XSS, CSRF) ! File Upload, Download ! MvcContext (Easy Specifying URL) ! Hybrid Class (HTML and REST) ! More Details, See GUGJ Slides below ! http://www.slideshare.net/masatoshitada7/java-ee-8mvc-10 35
  • 36. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Conclusions of this chapter ! MVC 1.0 + Thymeleaf covers almost features of Struts! ! Need to implement Transaction Token and Form-Binding By Yourself ! Features of MVC are Simple, Reveraging existing Java EE Features. 36
  • 37. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ③Using Jersey MVC & RESTEasy HTML in EE 7 37
  • 38. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. What framework should we use in Java EE 7? ! MVC 1.0 is Java EE 8 ! Java EE 8 will be released in 2017 H1 38 Let’s use Jersey MVC or RESTEasy HTML in EE7!
  • 39. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. What’s Jersey MVC? ! Original Extension of Jersey(JAX-RS RI) ! Similar to MVC 1.0 ! GlassFish/Payara inside ! WebLogic not inside 39
  • 40. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. What’s RESTEasy HTML? ! Original Extension of RESTEasy (other implementation of JAX-RS) ! RESTEasy is inside WildFly/JBoss,
 but RESTEasy HTML is not inside 40
  • 41. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Basic Jersey MVC ! Register MvcFeature class to Your Application sub class (ResourceConfig is Convinient) 41 @ApplicationPath("/api") public class MyApplication extends ResourceConfig { public MyApplication() { register(MvcFeature.class); property(MvcFeature.TEMPLATE_BASE_PATH, "/WEB-INF/views/"); packages(true, "com.example.rest"); } } jjug-jersey-mvc/src/main/java/com/example/rest/MyApplication.java ※Italic is Jersey MVC’s feature
  • 42. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Basic Jersey MVC ! Return Viewable in controller methods 42 @Path("/employee") public class EmployeeController { @GET @Path("/index") public ThymeleafViewable index(…) { return new ThymeleafViewable( "employee/index.html"); } } My original class (Viewable’s subclass) jjug-jersey-mvc/src/main/java/com/example/rest/controller/EmployeeControler.java ※Italic is Jersey MVC’s feature
  • 43. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Basic Jersey MVC ! Add value to Viewable constructor’s 2nd parameter 43 @Path("/employee") public class EmployeeController { @GET @Path("/result") public ThymeleafViewable result(…) { Map<String, Object> models = … return new ThymeleafViewable( "employee/result.html", models); } Put objects to Map jjug-jersey-mvc/src/main/java/com/example/rest/controller/EmployeeControler.java ※Italic is Jersey MVC’s feature
  • 44. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. How to Use Thymeleaf with Jersey MVC ! Implment TemplateProcessor interface (Provided by Jersey) ! AbstractTemplateProcessor class is useful ! implementation of TemplateProcessor 44
  • 45. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ThymeleafTemplateProcessor 45 @Provider public class ThymeleafTemplateProcessor extends AbstractTemplateProcessor<String> { private TemplateEngine templateEngine; @Inject public ThymeleafTemplateProcessor( Configuration config, ServletContext servletContext) { super(config, servletContext, "html", "html"); TemplateResolver templateResolver = new ServletContextTemplateResolver(); templateResolver.setPrefix((String) config.getProperty( MvcFeature.TEMPLATE_BASE_PATH)); templateEngine = new TemplateEngine(); templateEngine.setTemplateResolver(templateResolver); } // to next slide jjug-jersey-mvc/src/main/java/com/example/rest /thymeleaf/ThymeleafTemplateProcessor.java ※Italic is Jersey MVC’s feature
  • 46. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ThymeleafTemplateProcessor 46 // 続き @Override public void writeTo(...) { WebContext webContext = new WebContext( request, response, servletContext, request.getLocale()); Map<String, Object> map = (Map) viewable.getModel(); webContext.setVariables(map); templateEngine.process(viewable.getTemplateName(), webContext, response.getWriter()); } } jjug-jersey-mvc/src/main/java/com/example/rest /thymeleaf/ThymeleafTemplateProcessor.java Thymeleaf write the response ※Italic is Jersey MVC’s feature
  • 47. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Validation in Jersey MVC ! Jersey provides @ErrorTemplate annotation to specify error view, but… ! This annotation is feature for handling exception (not for validation) ! MVC 1.0 doesn’t have similar feature, so migration will be difficult ! Cannot use "Validation Group" and "Group Sequence" (Features of Bean Validation) 47
  • 48. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Validate in Controller Methods 48 @Inject Validator validator; @GET @Path("/result") public ThymeleafViewable result( @BeanParam EmployeeIdForm form) { Set<ConstraintViolation<EmployeeIdForm>> violations = validator.validate(form); if (!violations.isEmpty()) { Map<String, Object> model = …; model.put("violations", violations); return new ThymeleafViewable( "employee/index.html", model); } Execute Bean Validation No @Valid to arguments Validate On error, return to input view
  • 49. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Showing Error Message 49 <ul th:if="${violations != null}"> <li th:each="violation : ${violations}" th:text="${violation.message}"> This is Dummy Message </li> </ul>
  • 50. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. About This Method ! Advantage ! Pure JAX-RS code ! Easy MVC 1.0 migration ! Avoid excess framework customization ! Disadvantage ! It takes time and effort 50 I Tried a variety of methods, this method is best
  • 51. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Handling Exception ! ExceptionMapper ! Same to MVC 1.0 sample code 51
  • 52. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Redirect ! JAX-RSのコードで書けばOK 52 @GET @Path("/redirect") public Response redirect( @Context UriInfo uriInfo) throws Exception { URI location = uriInfo.getBaseUriBuilder() .path(HelloResource.class) .path("redirect2") .build(); return Response.status(Response.Status.FOUND) .location(location).build(); } UriInfo has variety of method to build URI Specify URI to Location header Status code 3xx
  • 53. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Basic RESTEasy HTML ! Create Application’s sub class ! No need to register any specific class ! By JAX-RS "Providers" 53 @ApplicationPath("/api") public class MyApplication extends Application { } jjug-resteasy-html/src/main/java/com/example/rest/MyApplication.java
  • 54. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Basic RESTEasy HTML ! Return Renderable in controller method 54 <<interface>> Renderable View class (Forward) Redirect class (Redirect)
  • 55. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Using Thymeleaf in RESTEasy HTML ! Create Renderable implementation class 55 <<interface>> Renderable View Redirect ThymeleafView
  • 56. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ThymeleafView 56 public class ThymeleafView implements Renderable { private String templateName; private Map<String, Object> models; private TemplateEngine templateEngine; public ThymeleafView(String templateName) { this(templateName, new HashMap<>()); } public ThymeleafView(String templateName, Map<String, Object> models) { this.templateName = templateName; this.models = models; } void setTemplateEngine(TemplateEngine templateEngine) { this.templateEngine = templateEngine; } Implement Renderable ※Italic is RESTEasy HTML feature
  • 57. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ThymeleafView 57 // from previous slide @Override public void render(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, WebApplicationException { response.setCharacterEncoding("UTF-8"); WebContext webContext = new WebContext( request, response, request.getServletContext(), request.getLocale()); webContext.setVariables(models); templateEngine.process(templateName, webContext, response.getWriter()); } } Call TemplateEngine#process() in render() ※Italic is RESTEasy HTML feature
  • 58. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Creating Interceptor Setting TemplateEngine to ThymeleafView ! Use JAX-RS WriterInterceptor ! Create custom annotation with NameBinding, to specify which controller apply interceptor ! There’re many ways(This is not only way) 58
  • 59. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Creating annotation 59 @NameBinding @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.TYPE}) @Documented public @interface ThymeleafController { } Create annotation with @NameBinding
  • 60. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Creating WriterInterceptor 60 @Provider @ThymeleafController public class ThymeleafWriterInterceptor implements WriterInterceptor { private TemplateEngine templateEngine; @PostConstruct public void init() { TemplateResolver resolver = new ServletContextTemplateResolver(); resolver.setPrefix("/WEB-INF/views/"); templateEngine = new TemplateEngine(); templateEngine.setTemplateResolver(resolver); } Specify annotation you created Implement WriterInterceptor
  • 61. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Creating WriterInterceptor 61 @Override public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException { Object entity = context.getEntity(); if (ThymeleafView.class.isAssignableFrom(entity.getClass())) { ThymeleafView thymeleafView = (ThymeleafView) context.getEntity(); thymeleafView.setTemplateEngine(templateEngine); } context.proceed(); } } Set TemplateEngine before context.proceed()
  • 62. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Controller 62 @GET @Path("result") @ThymeleafController public ThymeleafView result(…) { Map<String, Object> models = …; models.put("employee", employee); return new ThymeleafView( "employee/result.html", models); } Specify annotation →Applying interceptor View path and values ※Italic is RESTEasy HTML feature
  • 63. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Validation and Handling Exception ! Same as Jersey MVC sample code 63
  • 64. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Conclusions of this chapter ! In Java EE 7, 
 Use Jersey MVC or RESTEasy HTML! ! Controller methods, views and handling exceptions are same as MVC 1.0! ! They have no BindingResult, so validate in controller methods! 64
  • 65. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ④Other Java EE Technologies You Should Know 65
  • 66. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. JAX-RS ! Specific features of MVC 1.0/Jersey MVC/ RESTEasy HTML are not many ! To achieve what you want to do, and trouble-shooting, knowledge of JAX-RS is very important 66
  • 67. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. JAX-RS Reference ! JSR-339 JAX-RS 2.0 rev.A ! You should learn Processing Pipeline
 (Appendix C) ! https://jcp.org/en/jsr/detail?id=339 ! Jersey Document ! RESTEasy Document 67
  • 68. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Others ! Bean Validation ! CDI ! JPA 68
  • 69. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. ⑤Final Conclusions 69
  • 70. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Final Conclusions ! MVC 1.0 + Thymeleaf covers almost features of Struts! ! In EE 7, Use Jersey MVC or RESTEasy HTML! ! Understanding JAX-RS is very important! 70
  • 71. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Caution ! Jersey MVC and RESTEasy HTML are 
 NOT "Java EE 7 standard" ! They will be out of range 
 of server vendors’ support ! In "Java EE 7 standard", 
 JSF is the ONLY HTML Framework 71
  • 72. #ccc_cd4 (C) CASAREAL, Inc. All rights reserved. Enjoy Java EE!! ! Thank you! 72