SlideShare uma empresa Scribd logo
1 de 33
Refactoring to Seam ,[object Object],[object Object],[object Object]
AGENDA ,[object Object],[object Object],[object Object],[object Object],[object Object]
Java EE 5 Programming Model Registration Application Managed Bean Entity Class
DEMO
Java EE 5 Programming Model JSF Context DB Registration Application Managed Bean JSF Components Action Class Entity Class RegisterActionBean User ManagedBean
register.jsp: JSF In Action <td> Username </td> <td> < h:inputText   id = &quot;userName&quot;   value = &quot; #{ user.username } &quot;   required = &quot;true&quot; > < f:validateLength   minimum = &quot;5&quot;   maximum = &quot;15 &quot; / > <td> Real Name </td> <td> < h:inputText   id = &quot;name&quot;   value = &quot; #{ user.name } &quot;   required = &quot;true&quot; > <td> Password </td> <td> < h:inputSecret   id = &quot;password&quot;   value = &quot; #{ user.password } &quot;   required = &quot;true&quot; > < f:validateLength   minimum = &quot;5&quot;   maximum = &quot;15 &quot; / >    < h:commandButton   id = &quot;registerCommand&quot;   type = &quot;submit&quot;   value = &quot;Register&quot;   action = &quot; #{ user.register } &quot; / > A JSF Validator
register.jsp & BackingBean ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],ManagedBean username name password register “ user”
Managed Beans Configuration  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],faces-config.xml ,[object Object],[object Object],[object Object]
Managed Bean public class ManagedBean { private String  username ; private String  name ; private String  password ; public String getUsername() { return username; } Public String setUsernaame(String username) { this.username=username; } ... private RegisterActionLocal registerActionBean;  private InitialContext ctx; { try { ctx = new InitialContext(); registerActionBean = (RegisterActionLocal)    ctx.lookup(&quot;registration/RegisterActionBean/local&quot;); } catch (NamingException ex) { ex.printStackTrace(); } }  public String  register () { return registerActionBean.register(username, name, password); }
EJB 3.0 ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Java Persistence API (JPA) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
JPA – Object Relational Mapping ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Our Entity Bean ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
JPA Entity Manager ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Our Action Bean ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
AGENDA ,[object Object],[object Object],[object Object],[object Object],[object Object]
JBoss Seam ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
JBoss Seam Key Concepts ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
AGENDA ,[object Object],[object Object],[object Object],[object Object],[object Object]
Seam Registration Application  JSF Context DB Action Class Entity Class Seam Framework JSF Components RegisterActionBean User
Integrating the Seam Framework ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DEMO
faces-config.xml <managed-bean-name> user </... <managed-bean-class>org.ex... 4. ManagedBean userName name password register @Name(&quot; register &quot;) RegisterActionBean user em register 2. User @Name(&quot; use r &quot;)  @Scope(ScopeType.EVENT) username name password getters & setters 1. <h:inputText id=&quot;userName&quot; value=&quot;#{ user . username }&quot; ... <h:commandButton ... action=&quot;#{ register . register }&quot;/>  ... GONE!!! register.jsp 3.
DEMO
User.java (1 of 2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
User.java  (2 of 2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
RegisterAction.java  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
AGENDA ,[object Object],[object Object],[object Object],[object Object],[object Object]
Seam on GlassFish ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
DEMO
Summary ,[object Object],[object Object]
[object Object]
Questions & Answers

Mais conteúdo relacionado

Mais procurados

Mais procurados (19)

Introduction to Polymer and Firebase - Simon Gauvin
Introduction to Polymer and Firebase - Simon GauvinIntroduction to Polymer and Firebase - Simon Gauvin
Introduction to Polymer and Firebase - Simon Gauvin
 
Implicit objects advance Java
Implicit objects advance JavaImplicit objects advance Java
Implicit objects advance Java
 
Jstl 8
Jstl 8Jstl 8
Jstl 8
 
Java Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAXJava Web Programming [8/9] : JSF and AJAX
Java Web Programming [8/9] : JSF and AJAX
 
Implicit object.pptx
Implicit object.pptxImplicit object.pptx
Implicit object.pptx
 
Jsp Introduction Tutorial
Jsp Introduction TutorialJsp Introduction Tutorial
Jsp Introduction Tutorial
 
Data Access with JDBC
Data Access with JDBCData Access with JDBC
Data Access with JDBC
 
Trustparency web doc spring 2.5 & hibernate
Trustparency web doc   spring 2.5 & hibernateTrustparency web doc   spring 2.5 & hibernate
Trustparency web doc spring 2.5 & hibernate
 
Design patterns in Magento
Design patterns in MagentoDesign patterns in Magento
Design patterns in Magento
 
Java beans
Java beansJava beans
Java beans
 
Design patterns in PHP
Design patterns in PHPDesign patterns in PHP
Design patterns in PHP
 
JSP Error handling
JSP Error handlingJSP Error handling
JSP Error handling
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Java Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom TagsJava Web Programming [5/9] : EL, JSTL and Custom Tags
Java Web Programming [5/9] : EL, JSTL and Custom Tags
 
Jsp lecture
Jsp lectureJsp lecture
Jsp lecture
 
#31.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#31.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...#31.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
#31.스프링프레임워크 & 마이바티스 (Spring Framework, MyBatis)_스프링프레임워크 강좌, 재직자환급교육,실업자국비지원...
 
Jsp/Servlet
Jsp/ServletJsp/Servlet
Jsp/Servlet
 
Jsp
JspJsp
Jsp
 
hibernate with JPA
hibernate with JPAhibernate with JPA
hibernate with JPA
 

Destaque

Os Schlossnagle Theo
Os Schlossnagle TheoOs Schlossnagle Theo
Os Schlossnagle Theo
oscon2007
 
Os Fetterupdated
Os FetterupdatedOs Fetterupdated
Os Fetterupdated
oscon2007
 
Os Nolen Gebhart
Os Nolen GebhartOs Nolen Gebhart
Os Nolen Gebhart
oscon2007
 
Os Nightingale
Os NightingaleOs Nightingale
Os Nightingale
oscon2007
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
oscon2007
 

Destaque (8)

Os Pittaro
Os PittaroOs Pittaro
Os Pittaro
 
Os Schlossnagle Theo
Os Schlossnagle TheoOs Schlossnagle Theo
Os Schlossnagle Theo
 
Os Fetterupdated
Os FetterupdatedOs Fetterupdated
Os Fetterupdated
 
Os Nolen Gebhart
Os Nolen GebhartOs Nolen Gebhart
Os Nolen Gebhart
 
Os Lonergan
Os LonerganOs Lonergan
Os Lonergan
 
Os Nightingale
Os NightingaleOs Nightingale
Os Nightingale
 
Os Vandeven
Os VandevenOs Vandeven
Os Vandeven
 
J Ruby Whirlwind Tour
J Ruby Whirlwind TourJ Ruby Whirlwind Tour
J Ruby Whirlwind Tour
 

Semelhante a Os Leonard

[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
Carles Farré
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
Sagar Nakul
 

Semelhante a Os Leonard (20)

JavaEE Spring Seam
JavaEE Spring SeamJavaEE Spring Seam
JavaEE Spring Seam
 
Seam Introduction
Seam IntroductionSeam Introduction
Seam Introduction
 
Jsp
JspJsp
Jsp
 
Struts2
Struts2Struts2
Struts2
 
Custom Action Framework
Custom Action FrameworkCustom Action Framework
Custom Action Framework
 
Spring Capitulo 05
Spring Capitulo 05Spring Capitulo 05
Spring Capitulo 05
 
Struts Overview
Struts OverviewStruts Overview
Struts Overview
 
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
[DSBW Spring 2009] Unit 07: WebApp Design Patterns & Frameworks (3/3)
 
Struts 2 + Spring
Struts 2 + SpringStruts 2 + Spring
Struts 2 + Spring
 
jBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developersjBPM5 in action - a quickstart for developers
jBPM5 in action - a quickstart for developers
 
ActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group PresentationActiveWeb: Chicago Java User Group Presentation
ActiveWeb: Chicago Java User Group Presentation
 
Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Struts2
Struts2Struts2
Struts2
 
Struts,Jsp,Servlet
Struts,Jsp,ServletStruts,Jsp,Servlet
Struts,Jsp,Servlet
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
Strutsjspservlet
Strutsjspservlet Strutsjspservlet
Strutsjspservlet
 
A Complete Tour of JSF 2
A Complete Tour of JSF 2A Complete Tour of JSF 2
A Complete Tour of JSF 2
 
Jsfsunum
JsfsunumJsfsunum
Jsfsunum
 
java ee 6 Petcatalog
java ee 6 Petcatalogjava ee 6 Petcatalog
java ee 6 Petcatalog
 
Facelets
FaceletsFacelets
Facelets
 

Mais de oscon2007

Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5
oscon2007
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifm
oscon2007
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Mole
oscon2007
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashears
oscon2007
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swp
oscon2007
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Myths
oscon2007
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
oscon2007
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillips
oscon2007
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdated
oscon2007
 
Adventures In Copyright Reform
Adventures In Copyright ReformAdventures In Copyright Reform
Adventures In Copyright Reform
oscon2007
 

Mais de oscon2007 (20)

Solr Presentation5
Solr Presentation5Solr Presentation5
Solr Presentation5
 
Os Borger
Os BorgerOs Borger
Os Borger
 
Os Harkins
Os HarkinsOs Harkins
Os Harkins
 
Os Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman WiifmOs Fitzpatrick Sussman Wiifm
Os Fitzpatrick Sussman Wiifm
 
Os Bunce
Os BunceOs Bunce
Os Bunce
 
Yuicss R7
Yuicss R7Yuicss R7
Yuicss R7
 
Performance Whack A Mole
Performance Whack A MolePerformance Whack A Mole
Performance Whack A Mole
 
Os Fogel
Os FogelOs Fogel
Os Fogel
 
Os Lanphier Brashears
Os Lanphier BrashearsOs Lanphier Brashears
Os Lanphier Brashears
 
Os Tucker
Os TuckerOs Tucker
Os Tucker
 
Os Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman SwpOs Fitzpatrick Sussman Swp
Os Fitzpatrick Sussman Swp
 
Os Furlong
Os FurlongOs Furlong
Os Furlong
 
Os Berlin Dispelling Myths
Os Berlin Dispelling MythsOs Berlin Dispelling Myths
Os Berlin Dispelling Myths
 
Os Kimsal
Os KimsalOs Kimsal
Os Kimsal
 
Os Pruett
Os PruettOs Pruett
Os Pruett
 
Os Alrubaie
Os AlrubaieOs Alrubaie
Os Alrubaie
 
Os Keysholistic
Os KeysholisticOs Keysholistic
Os Keysholistic
 
Os Jonphillips
Os JonphillipsOs Jonphillips
Os Jonphillips
 
Os Urnerupdated
Os UrnerupdatedOs Urnerupdated
Os Urnerupdated
 
Adventures In Copyright Reform
Adventures In Copyright ReformAdventures In Copyright Reform
Adventures In Copyright Reform
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Os Leonard

  • 1.
  • 2.
  • 3. Java EE 5 Programming Model Registration Application Managed Bean Entity Class
  • 5. Java EE 5 Programming Model JSF Context DB Registration Application Managed Bean JSF Components Action Class Entity Class RegisterActionBean User ManagedBean
  • 6. register.jsp: JSF In Action <td> Username </td> <td> < h:inputText id = &quot;userName&quot; value = &quot; #{ user.username } &quot; required = &quot;true&quot; > < f:validateLength minimum = &quot;5&quot; maximum = &quot;15 &quot; / > <td> Real Name </td> <td> < h:inputText id = &quot;name&quot; value = &quot; #{ user.name } &quot; required = &quot;true&quot; > <td> Password </td> <td> < h:inputSecret id = &quot;password&quot; value = &quot; #{ user.password } &quot; required = &quot;true&quot; > < f:validateLength minimum = &quot;5&quot; maximum = &quot;15 &quot; / > < h:commandButton id = &quot;registerCommand&quot; type = &quot;submit&quot; value = &quot;Register&quot; action = &quot; #{ user.register } &quot; / > A JSF Validator
  • 7.
  • 8.
  • 9. Managed Bean public class ManagedBean { private String username ; private String name ; private String password ; public String getUsername() { return username; } Public String setUsernaame(String username) { this.username=username; } ... private RegisterActionLocal registerActionBean; private InitialContext ctx; { try { ctx = new InitialContext(); registerActionBean = (RegisterActionLocal) ctx.lookup(&quot;registration/RegisterActionBean/local&quot;); } catch (NamingException ex) { ex.printStackTrace(); } } public String register () { return registerActionBean.register(username, name, password); }
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20. Seam Registration Application JSF Context DB Action Class Entity Class Seam Framework JSF Components RegisterActionBean User
  • 21.
  • 22. DEMO
  • 23. faces-config.xml <managed-bean-name> user </... <managed-bean-class>org.ex... 4. ManagedBean userName name password register @Name(&quot; register &quot;) RegisterActionBean user em register 2. User @Name(&quot; use r &quot;) @Scope(ScopeType.EVENT) username name password getters & setters 1. <h:inputText id=&quot;userName&quot; value=&quot;#{ user . username }&quot; ... <h:commandButton ... action=&quot;#{ register . register }&quot;/> ... GONE!!! register.jsp 3.
  • 24. DEMO
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30. DEMO
  • 31.
  • 32.