SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
Markos Fragkakis
JHUG meeting 20 Nov 2010
My experience with JBoss Seam and JSF:
•  Used plain JSF 1.2 for prototype (~1 month)
•  Used Seam 2.2 in actual implementation (~9
months)

What is this presentation about?
•  Common tasks where Seam makes life easier
    Separated business logic
     in:	
     ◦    JSF managed beans	
     ◦    Business components (EJBs)	



    EJB lookup	
Context context = new InitialContext();   	
context.lookup("java:comp/env/...");
  One kind of “stuff ”
  Seam Components
     ◦  POJOs
     ◦  EJB
     ◦  Entities
    Seam unifies Java EE:
     ◦    Dependency Injection
     ◦    Transactions
     ◦    Security

  No separation between front-
   end components and business
   components.
  Define your own architecture
faces-config.xml	
    JSF
                                        <managed-bean>	
     ◦  Through faces-config.xml           <managed-bean-name>myBean1</managed-bean-name>	
                                          <managed-bean-class>mypackage.MyBean1</managed-
                                          bean-class>	

    Java EE: @EJB                        <managed-bean-scope>application</managed-bean-
                                          scope>	
                                       </managed-bean>	
     ◦  Servlets, Filters, Listeners
                                       <managed-bean>	
     ◦  Tag handlers, tag library          <managed-bean-name>myBean2</managed-bean-name>	

        event listeners                   <managed-bean-class>mypackage.MyBean2</managed-
                                          bean-class>	
                                          <managed-bean-scope>request</managed-bean-scope>	
     … but not in JSF Managed              <managed-property>	
      beans (backing beans)                    <property-name>myBean1</property-name>	
                                               <value>#{myBean1}</value>	
                                           </managed-property>	
                                       </managed-bean>
    Injection of Seam
     components       @Name("myBean")	
                        @Scope(ScopeType.EVENT)	
     ◦  EJB             public class MyBean {	

     ◦  Entities           @In(create=true)	

     ◦  POJOs              private AccountFacadeRemote accountFacade;	


    Outjection            @In(scope=ScopeType.CONVERSATION)	
                           @Out(scope=ScopeType.CONVERSATION)	
                           private AccountEntity accountEntity;	

                           @In	
                           @Out	
                           private SomePojo somePojo;	
                           …
    State:
     ◦  Server (i.e. session)
     ◦  Client (i.e. hidden fields)
     ◦  Combination
    JSF
     ◦  Request parameters
        (i.e. hidden fields)
     ◦  Cookies
     ◦  URLs: http://jhug.gr/user/markos
    Maybe a problem:
     object != object
     JSF UI Component
      tree and state
     ◦  Tomahawk <t:saveState>
     ◦  Richfaces <a4j:keepAlive>
    If client-side state:
     object != object
    Session
     ◦  Problems:
         Increased memory usage
         Scalability problems
         Need to consider
          multiple tabs
    Seam scopes:
     ◦  Event (Request)
     ◦  Session
     ◦  Application
     ◦  Page
     ◦  Stateless
     ◦  Business Process
     ◦  Conversation
    What is a conversation?
     ◦  Lives for multiple requests
     ◦  Stateful, but not session
  Conversation end / timeout
  Aggressive management
    Application Security:
     ◦  Page-level security
     ◦  Component-level security
    JSF does not specify security
    Can a filter be used?
     ◦  Does View Handler use the
        Servlet Request Dispatcher?
          JSP:Yes
<filter-mapping> 	
     <filter-name>My Security Filter</filter-name> 	
     <url-pattern>/view2.jsp</url-pattern>	
     <dispatcher>REQUEST</dispatcher> 	
     <dispatcher>FORWARD</dispatcher> 	
</filter-mapping>
          Facelets: No
     Both Page-level and Component-level security
     Some examples:
      ◦  Page-level authentication / authorization
<pages login-view-id="/login.xhtml"> 	
  <page view-id=”admin*" login-required="true”>	
     	<restrict>#{s:hasRole('admin')}</restrict>	
 </page> 	
</pages>	


<security:identity authenticate-method="#{authManager.authenticate}"/>	

      ◦  Page customization	
<s:link view="/jhug/deleteMember.xhtml" value="Delete" rendered="#{s:hasRole('admin') ||	
s:hasRole(’usermanager')}"/> 	
      ◦  Component-level authorization	

@Name("myBean")	
@Scope(ScopeType.SESSION)	
@Restrict("#{s:hasRole('admin')}") 	
public class MyBean implements Serializable {	
…
<h:commandLink value="Click here” action="#{myBean.method}">	
  <f:setPropertyActionListener target="#{myBean.methodParameter}”
value="#{value}" />	
</h:commandLink>	

public class MyBean {	
    private String param;	

     public String method() {	
         if("something".equals(param)) {	
             return "ok";	
         }	
         return "notOk";	
     }	

     public String getParam() {	
         return param;	
     }	
     public void setParam(String param) {	
         this.param = param;	
     }	
}
<h:commandLink value="Click here” action="#{myBean.method(value)}” />	


@Name("myBean")	
public class MyBean {	

     public String method(String param) {	
         if("something".equals(param)) {	
             return "ok";	
         }	
         return "notOk";	
     }	

}
  Help:
  ◦  Good books
  ◦  Extensive, up-to-date documentation
  ◦  Old forum, somewhat inactive
  ◦  StackOverflow.com
  Issues:
  ◦  Works best on JBoss AS
  ◦  Seam 2 issues are resolved slowly
     (Focus on Seam 3)
?

Mais conteúdo relacionado

Mais procurados

Chapter 8 overview
Chapter 8 overviewChapter 8 overview
Chapter 8 overviewali raza
 
Les principales failles de sécurité des applications Web actuelles
Les principales failles de sécurité des applications Web actuellesLes principales failles de sécurité des applications Web actuelles
Les principales failles de sécurité des applications Web actuellesXavier Kress
 
Automated Testing for IBM i
Automated Testing for IBM iAutomated Testing for IBM i
Automated Testing for IBM iADC Austin Tech
 
Introduction à spring boot
Introduction à spring bootIntroduction à spring boot
Introduction à spring bootAntoine Rey
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez YalonAdar Weidman
 
Alphorm.com support de la formation Git avancé
Alphorm.com support de la formation Git avancé Alphorm.com support de la formation Git avancé
Alphorm.com support de la formation Git avancé Alphorm
 
Securing AEM webapps by hacking them
Securing AEM webapps by hacking themSecuring AEM webapps by hacking them
Securing AEM webapps by hacking themMikhail Egorov
 
가상화 기반 재해복구 솔루션(Zerto)
가상화 기반 재해복구 솔루션(Zerto)가상화 기반 재해복구 솔루션(Zerto)
가상화 기반 재해복구 솔루션(Zerto)영철 현
 
Management des vulnérabilités - Greenbone OpenVas
Management des vulnérabilités - Greenbone OpenVasManagement des vulnérabilités - Greenbone OpenVas
Management des vulnérabilités - Greenbone OpenVasEyesOpen Association
 
Présentation spring data Matthieu Briend
Présentation spring data  Matthieu BriendPrésentation spring data  Matthieu Briend
Présentation spring data Matthieu BriendSOAT
 
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webappsMikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webappshacktivity
 
Javascript pour les Développeurs WEB
Javascript pour les Développeurs WEBJavascript pour les Développeurs WEB
Javascript pour les Développeurs WEBAbbes Rharrab
 
Présentation Maven
Présentation MavenPrésentation Maven
Présentation MavenSOAT
 
API Maturity Model (Webcast with Accenture)
API Maturity Model (Webcast with Accenture)API Maturity Model (Webcast with Accenture)
API Maturity Model (Webcast with Accenture)Apigee | Google Cloud
 
Workshop spring session 2 - La persistance au sein des applications Java
Workshop spring   session 2 - La persistance au sein des applications JavaWorkshop spring   session 2 - La persistance au sein des applications Java
Workshop spring session 2 - La persistance au sein des applications JavaAntoine Rey
 
WebAssembly: In a Nutshell
WebAssembly: In a NutshellWebAssembly: In a Nutshell
WebAssembly: In a NutshellRangHo Lee
 

Mais procurados (20)

Secure coding practices
Secure coding practicesSecure coding practices
Secure coding practices
 
Chapter 8 overview
Chapter 8 overviewChapter 8 overview
Chapter 8 overview
 
Les principales failles de sécurité des applications Web actuelles
Les principales failles de sécurité des applications Web actuellesLes principales failles de sécurité des applications Web actuelles
Les principales failles de sécurité des applications Web actuelles
 
Support de cours Spring M.youssfi
Support de cours Spring  M.youssfiSupport de cours Spring  M.youssfi
Support de cours Spring M.youssfi
 
Automated Testing for IBM i
Automated Testing for IBM iAutomated Testing for IBM i
Automated Testing for IBM i
 
Introduction à spring boot
Introduction à spring bootIntroduction à spring boot
Introduction à spring boot
 
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
Checkmarx meetup API Security -  API Security top 10 - Erez YalonCheckmarx meetup API Security -  API Security top 10 - Erez Yalon
Checkmarx meetup API Security - API Security top 10 - Erez Yalon
 
Alphorm.com support de la formation Git avancé
Alphorm.com support de la formation Git avancé Alphorm.com support de la formation Git avancé
Alphorm.com support de la formation Git avancé
 
Securing AEM webapps by hacking them
Securing AEM webapps by hacking themSecuring AEM webapps by hacking them
Securing AEM webapps by hacking them
 
API Security Lifecycle
API Security LifecycleAPI Security Lifecycle
API Security Lifecycle
 
가상화 기반 재해복구 솔루션(Zerto)
가상화 기반 재해복구 솔루션(Zerto)가상화 기반 재해복구 솔루션(Zerto)
가상화 기반 재해복구 솔루션(Zerto)
 
Management des vulnérabilités - Greenbone OpenVas
Management des vulnérabilités - Greenbone OpenVasManagement des vulnérabilités - Greenbone OpenVas
Management des vulnérabilités - Greenbone OpenVas
 
Azure Service Fabric
Azure Service FabricAzure Service Fabric
Azure Service Fabric
 
Présentation spring data Matthieu Briend
Présentation spring data  Matthieu BriendPrésentation spring data  Matthieu Briend
Présentation spring data Matthieu Briend
 
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webappsMikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
Mikhail Egorov - Hunting for bugs in Adobe Experience Manager webapps
 
Javascript pour les Développeurs WEB
Javascript pour les Développeurs WEBJavascript pour les Développeurs WEB
Javascript pour les Développeurs WEB
 
Présentation Maven
Présentation MavenPrésentation Maven
Présentation Maven
 
API Maturity Model (Webcast with Accenture)
API Maturity Model (Webcast with Accenture)API Maturity Model (Webcast with Accenture)
API Maturity Model (Webcast with Accenture)
 
Workshop spring session 2 - La persistance au sein des applications Java
Workshop spring   session 2 - La persistance au sein des applications JavaWorkshop spring   session 2 - La persistance au sein des applications Java
Workshop spring session 2 - La persistance au sein des applications Java
 
WebAssembly: In a Nutshell
WebAssembly: In a NutshellWebAssembly: In a Nutshell
WebAssembly: In a Nutshell
 

Semelhante a JBoss Seam vs JSF

Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJini Lee
 
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces Skills Matter
 
EJB 3.0 course Sildes and matrial
EJB 3.0 course Sildes and matrialEJB 3.0 course Sildes and matrial
EJB 3.0 course Sildes and matrialMohamed Ali Ibrahim
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionArun Gupta
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerArun Gupta
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGArun Gupta
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 DemystifiedAnkara JUG
 
Session 4 Tp4
Session 4 Tp4Session 4 Tp4
Session 4 Tp4phanleson
 
Securing Java EE apps using WildFly Elytron
Securing Java EE apps using WildFly ElytronSecuring Java EE apps using WildFly Elytron
Securing Java EE apps using WildFly ElytronJan Kalina
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Arun Gupta
 
Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Arun Gupta
 
Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012Atlassian
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest servicesIoan Eugen Stan
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Rohit Kelapure
 
Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3phanleson
 

Semelhante a JBoss Seam vs JSF (20)

Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
 
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
In The Brain of Cagatay Civici: Exploring JavaServer Faces 2.0 and PrimeFaces
 
EJB 3.0 course Sildes and matrial
EJB 3.0 course Sildes and matrialEJB 3.0 course Sildes and matrial
EJB 3.0 course Sildes and matrial
 
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnitionJava EE 6 & GlassFish = Less Code + More Power @ DevIgnition
Java EE 6 & GlassFish = Less Code + More Power @ DevIgnition
 
Java EE 6 = Less Code + More Power
Java EE 6 = Less Code + More PowerJava EE 6 = Less Code + More Power
Java EE 6 = Less Code + More Power
 
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUGJava EE 6 & GlassFish = Less Code + More Power at CEJUG
Java EE 6 & GlassFish = Less Code + More Power at CEJUG
 
Java EE7 Demystified
Java EE7 DemystifiedJava EE7 Demystified
Java EE7 Demystified
 
Session 4 Tp4
Session 4 Tp4Session 4 Tp4
Session 4 Tp4
 
Securing Java EE apps using WildFly Elytron
Securing Java EE apps using WildFly ElytronSecuring Java EE apps using WildFly Elytron
Securing Java EE apps using WildFly Elytron
 
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
Java EE 6 & GlassFish 3: Light-weight, Extensible, and Powerful @ Silicon Val...
 
Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6Boston 2011 OTN Developer Days - Java EE 6
Boston 2011 OTN Developer Days - Java EE 6
 
Javaee6 Overview
Javaee6 OverviewJavaee6 Overview
Javaee6 Overview
 
Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012Using JIRA to build a culture of innovation - Atlassian Summit 2012
Using JIRA to build a culture of innovation - Atlassian Summit 2012
 
Javascript ui for rest services
Javascript ui for rest servicesJavascript ui for rest services
Javascript ui for rest services
 
Jsf
JsfJsf
Jsf
 
Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010Contextual Dependency Injection for Apachecon 2010
Contextual Dependency Injection for Apachecon 2010
 
JBoss Seam 1 part
JBoss Seam 1 partJBoss Seam 1 part
JBoss Seam 1 part
 
Session 3 Tp3
Session 3 Tp3Session 3 Tp3
Session 3 Tp3
 
Spring frame work
Spring frame workSpring frame work
Spring frame work
 
Java EE Services
Java EE ServicesJava EE Services
Java EE Services
 

Último

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
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 TerraformAndrey Devyatkin
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+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...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

JBoss Seam vs JSF

  • 2. My experience with JBoss Seam and JSF: •  Used plain JSF 1.2 for prototype (~1 month) •  Used Seam 2.2 in actual implementation (~9 months) What is this presentation about? •  Common tasks where Seam makes life easier
  • 3.   Separated business logic in: ◦  JSF managed beans ◦  Business components (EJBs)   EJB lookup Context context = new InitialContext(); context.lookup("java:comp/env/...");
  • 4.   One kind of “stuff ”   Seam Components ◦  POJOs ◦  EJB ◦  Entities   Seam unifies Java EE: ◦  Dependency Injection ◦  Transactions ◦  Security   No separation between front- end components and business components.   Define your own architecture
  • 5. faces-config.xml   JSF <managed-bean> ◦  Through faces-config.xml <managed-bean-name>myBean1</managed-bean-name> <managed-bean-class>mypackage.MyBean1</managed- bean-class>   Java EE: @EJB <managed-bean-scope>application</managed-bean- scope> </managed-bean> ◦  Servlets, Filters, Listeners <managed-bean> ◦  Tag handlers, tag library <managed-bean-name>myBean2</managed-bean-name> event listeners <managed-bean-class>mypackage.MyBean2</managed- bean-class> <managed-bean-scope>request</managed-bean-scope> … but not in JSF Managed <managed-property> beans (backing beans) <property-name>myBean1</property-name> <value>#{myBean1}</value> </managed-property> </managed-bean>
  • 6.   Injection of Seam components @Name("myBean") @Scope(ScopeType.EVENT) ◦  EJB public class MyBean { ◦  Entities @In(create=true) ◦  POJOs private AccountFacadeRemote accountFacade;   Outjection @In(scope=ScopeType.CONVERSATION) @Out(scope=ScopeType.CONVERSATION) private AccountEntity accountEntity; @In @Out private SomePojo somePojo; …
  • 7.   State: ◦  Server (i.e. session) ◦  Client (i.e. hidden fields) ◦  Combination   JSF ◦  Request parameters (i.e. hidden fields) ◦  Cookies ◦  URLs: http://jhug.gr/user/markos   Maybe a problem: object != object
  • 8.   JSF UI Component tree and state ◦  Tomahawk <t:saveState> ◦  Richfaces <a4j:keepAlive>   If client-side state: object != object
  • 9.   Session ◦  Problems:   Increased memory usage   Scalability problems   Need to consider multiple tabs
  • 10.   Seam scopes: ◦  Event (Request) ◦  Session ◦  Application ◦  Page ◦  Stateless ◦  Business Process ◦  Conversation   What is a conversation? ◦  Lives for multiple requests ◦  Stateful, but not session
  • 11.
  • 12.   Conversation end / timeout   Aggressive management
  • 13.   Application Security: ◦  Page-level security ◦  Component-level security   JSF does not specify security   Can a filter be used? ◦  Does View Handler use the Servlet Request Dispatcher?   JSP:Yes <filter-mapping> <filter-name>My Security Filter</filter-name> <url-pattern>/view2.jsp</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping>   Facelets: No
  • 14.   Both Page-level and Component-level security   Some examples: ◦  Page-level authentication / authorization <pages login-view-id="/login.xhtml"> <page view-id=”admin*" login-required="true”> <restrict>#{s:hasRole('admin')}</restrict> </page> </pages> <security:identity authenticate-method="#{authManager.authenticate}"/> ◦  Page customization <s:link view="/jhug/deleteMember.xhtml" value="Delete" rendered="#{s:hasRole('admin') || s:hasRole(’usermanager')}"/> ◦  Component-level authorization @Name("myBean") @Scope(ScopeType.SESSION) @Restrict("#{s:hasRole('admin')}") public class MyBean implements Serializable { …
  • 15. <h:commandLink value="Click here” action="#{myBean.method}"> <f:setPropertyActionListener target="#{myBean.methodParameter}” value="#{value}" /> </h:commandLink> public class MyBean { private String param; public String method() { if("something".equals(param)) { return "ok"; } return "notOk"; } public String getParam() { return param; } public void setParam(String param) { this.param = param; } }
  • 16. <h:commandLink value="Click here” action="#{myBean.method(value)}” /> @Name("myBean") public class MyBean { public String method(String param) { if("something".equals(param)) { return "ok"; } return "notOk"; } }
  • 17.   Help: ◦  Good books ◦  Extensive, up-to-date documentation ◦  Old forum, somewhat inactive ◦  StackOverflow.com   Issues: ◦  Works best on JBoss AS ◦  Seam 2 issues are resolved slowly (Focus on Seam 3)
  • 18. ?