SlideShare ist ein Scribd-Unternehmen logo
1 von 18
Downloaden Sie, um offline zu lesen
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)
?

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

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.pdfsudhanshuwaghmare1
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
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
 
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.pptxRustici Software
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
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 WorkerThousandEyes
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
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
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
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
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 

Kürzlich hochgeladen (20)

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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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...
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
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
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
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
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
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...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 

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