Download presentation
Presentation is loading. Please wait.
Published byDelphia Walsh Modified over 7 years ago
1
Rest Services with Play Framework, MySQL, Adding Security with JWT
México
2
Independent Consultor #geek #traveler #speaker
Community Leader JDuchess Chapter Guatemala, Devs+502 Ex-JUG Member Guatemala Java Users Group (GuateJUG) Independent Consultor Full Stack Developer, Front-end y Back-end with Java, Mobile Development Android and iOS CTO at Produactivity #geek #traveler #speaker Mercedes Wyss @itrjwyss
3
Agenda Play Framework Web Services Restful JSONs
Database Connection (JPA, JDBC) JWT (Json Web Tokens)
4
Agenda Play Framework Web Services Restful JSONs
Database Connection (JPA, JDBC) JWT (Json Web Tokens)
6
Play Framework Makes it easy to build web applications with Java and Scala. Is based on a lightweight, stateless, web-friendly architecture. Built on Akka, provides predictable and minimal resources consumption (CPU, memory, threads) for highly-scalable applications.
8
Servidor: 1 CPU 2 GB Ram
9
Play Framework Develop using Java or Scala Is reactive
Use the architecture MVC Uses Netty as App Server, AKKA Http since 2.6.x (Fewer configurations) Simulates the behavior of JRebel (more code, less deploys)
11
JVM
12
Reactive
13
MVC
14
How start a Play project?
We need to use SBT Create sbt new playframework/play-scala-seed.g8 sbt new playframework/play-java-seed.g8 Deploy sbt run
16
Full Project Structure
17
Simple Project Structure
20
Agenda Play Framework Web Services Restful JSONs
Database connection (JPA, JDBC) JWT (Json Web Tokens)
22
Web Services HyperText Transfer Protocol (HTTP)
Allows communication between a client and a server Provide a standard means of interoperating between different software apps Characterized for interoperability and extensibility Based on XML
23
Linda. com (June 2017) https://www. lynda
24
SOAP Simple Object Access Protocol XML-based
Use WSDL as specification description (Web Services Description Language) Need to follow a communication protocol
26
Restful Software Architecture based on HTTP method
(Get, Post, Put, Delete, etc) Typically use JSON, but can use XML, Text
27
Madhaiyan Muthu (June 2017) https://www. slideshare
29
Agenda Play Framework Web Services Restful JSONs
Database connection (JPA, JDBC) JWT (Json Web Tokens)
31
JSON JavaScript Object Notation
Is a lightweight data-interchange format Self-describing Human-reading Is a Protocol
32
JSON Example
33
JSON Scheme
34
Package controllers; import play.libs.Json; import play.mvc.Controller; import play.mvc.Result; public class HomeController extends Controller { public Result index(){ JsonNode json = request().body().asJson(); PostRequest request = Json.fromJson(json, PostRequest.class); return ok(Json.toJson(request)); }
35
Agenda Play Framework Web Services Restful JSONs JWT (Json Web Tokens)
Database connection (JPA, JDBC)
37
JWT Is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object.
38
Auth0 (June 2017) https://cdn.auth0.com/content/jwt/jwt-diagram.png
39
JWT Structure
40
JWT Structure
41
JWT Structure
42
Agenda Play Framework Web Services Restful JSONs JWT (Json Web Tokens)
Database connection (JPA, JDBC)
46
To End Let’s Finish our Exercise
México
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.