• Save
Jsfsunum
Upcoming SlideShare
Loading in...5
×
 

Jsfsunum

on

  • 1,528 views

 

Statistics

Views

Total Views
1,528
Views on SlideShare
1,480
Embed Views
48

Actions

Likes
0
Downloads
0
Comments
0

2 Embeds 48

http://www.linkedin.com 37
https://www.linkedin.com 11

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Jsfsunum Jsfsunum Presentation Transcript

  • Java Server Faces Çağatay Çivici Apache MyFaces PMC [email_address]
  • Çağatay Çivici
    • Apache MyFaces PMC(Project Management Committee) member
    • Apress’in “The Definitive Guide to Apache MyFaces and Facelets” co-author
    • Referenced “Core JavaServer Faces 2nd Edition”
    • Recognized speaker in international seminars such as JSFDays08
    • Oracle RCF(Rich Client Framework) member
    • Krank (CRUD Framework for JSF-Spring-JPA) member
    • Sourceforge jsf-comp member
    • Spring Security(Acegi) JSF Integration author
    • JSF Chart Creator project lead
    • FacesTrace project lead
    • YUI4JSF project lead
    • Blog: http://www.prime.com.tr/cagataycivici
    • Prime Teknoloji - 2008
  • Prime Teknoloji Danışmanlık
    • All about AGILE
    • XP (Extreme Programming)
    • TDD (Test Driven Programming)
    • Testing (Selenium, Mock Objects)
    • JSF, Spring, JPA
    • Maven, Ant, Continous Integration(Continuum, Cruise Control)
    View slide
  • Agenda
    • What is JSF?
    • JSF Component Model
    • IOC and Managed Beans
    • Binding mechanism
    • JSF Request Lifecycle
    • Navigations
    • Internalization and Resource Bundles
    • Extending JSF
    • Integration with Other Frameworks (Spring Framework Example)
    • Ajax with JSF
    • Facelets
    • Apache MyFaces
    • IDE Support
    • Future of JSF
    • Questions
    View slide
  • What is JSF?
    • a component oriented and event driven web framework to build up web applications.
    • a Standard – JSR
    • Two Implementations
      • Sun RI and Apache MyFaces
    • Similar concepts
      • Asp.net
      • Tapestry
      • Swing
  • Architecture
  • JSF Component Model
    • Covers a wide range components.
      • Reusable
      • Customizable
      • State aware
    • Easy to plug in third party components.
    • Easy to create custom components of your own.
    • Renderers brings abstraction
  • Simple Example: HtmlInputText
    • Declared as;
      • <h:inputText id=“id1” value=“xxx” />
    • Gives the output
      • <input type=“text” id=“parentformid:id1” value=“xxx” />
    • Customization attributes like;
      • Styleclass
      • Javascript events (onmousover etc...)
  • JSF Component Tree
    • Components are represented using a tree.
    • <h:form>
    • <h:inputText />
    • <h:inputText />
    • <h:commandButton />
    • </h:form>
  • IOC and Managed Beans
    • <managed-bean>
    • <managed-bean-name> demo </managed-bean-name>
    • <managed-bean-class> com.prime.tutorial.view.demo
    • </managed-bean-class>
    • <managed-bean-scope>request</managed-bean-scope>
    • </managed-bean>
  • IOC and Managed Beans
    • JSF uses it’s own container to manage the beans in it’s context.
    • <managed-bean>
    • <managed-bean-name>pc_Index</managed-bean-name>
    • <managed-bean-class>demo.Index</managed-bean-class>
    • <managed-bean-scope>request</managed-bean-scope>
    • <managed-property>
    • <property-name> someVariable </property-name>
    • <value>#{ pc_DB }</value>
    • </managed-property>
    • </managed-bean>
    • <managed-bean>
    • <managed-bean-name> pc_DB </managed-bean-name>
    • <managed-bean-class>demo. Db </managed-bean-class>
    • <managed-bean-scope> session </managed-bean-scope>
    • </managed-bean>
  • Scopelar
    • Request : Request->Response
    • Session : Kullanici sessioni
    • Application : Uygulama start->stop
    • None : JSF sayfalarinda kullanilamaz, istege gore yaratilir, bir yerde tutulmaz
  • Binding makes JSF powerful
    • Value binding; binds a bean’s variable to a component.
      • <h:inputText value=“#{person.name}” />
    • Action binding, binds a method to an action component.
      • <h:commandButton action=“{personSavePage.savePerson}” />
  • Binding
  • Events
    • <h:commandButton value=“Save” action=“#{createMovie.save}”>
    • public class CreateMovie {
    • public String kaydet() {
    • ...
    • }
    • }
  • Events
    • <h:commandButton value=“Save”
    • action=“#{createMovie.save}”
    • actionListener=“#{createMovie.saveListener}”>
    • public void saveActionListener(ActionEvent e) {
      • FacesContext context = FacesContext.getCurrentInstance();
      • String clientId = e.getComponent().getClientId(context);
    • }
  • JSF Request LifeCycle
  • Case Study
  • Conversion and Validation
    • Submitted form values are strings
    • Conversion takes place to convert these values to java objects
    • Validation mechanism validates these converted objects
      • Built-in converters and validators
      • Easy to write custom converters and validators
  • Navigations
    • <navigation-rule>
    • <from-view-id>/login.jsp</from-view-id>
    • <navigation-case>
    • <from-outcome>success</from-outcome>
    • <to-view-id>/mainmenu.jsp</to-view-id>
    • </navigation-case>
    • <navigation-case>
    • <from-outcome>failure</from-outcome>
    • <to-view-id>/login.jsp</to-view-id>
    • </navigation-case>
    • </navigation-rule>
    • Action specific
      • <from-action>#{loginBean.loginAction}</from-action>
    • Supports patterns
      • <from-view-id>*</from-view-id>
  • State Management
    • JSF saves and restores the state of the components in each faces request.
      • Client
        • As a hidden variable
      • Server
        • As a session entry
  • Extending JSF
    • Navigation Handler
    • View Handler
    • Custom Resolvers
    • Phaselisteners
    • Custom Components
  • Multilanguage
    • Support for resource bundles
      • <application> <locale-config> <default-locale>tr</default-locale> <supported-locale>en</supported-locale> <supported-locale>en_US</supported-locale> <supported-locale>de</supported-locale> </locale-config> <message-bundle> jsfsunum.messages
        • </message-bundle>
        • </application>
    • jsfsunum/messages.tr
      • msg_welcome = Merhaba
    • Bundles on faces pages
      • <f:loadBundle basename=“jsfsunum.labels&quot; var=&quot;msg&quot;/>
  • Integration with ...
    • JSF-Spring
      • Delegating Variable Resolver
      • XML Based Approach
      • Annotation Based Approach
      • Managing JSF Beans with Spring
    • EJB3 - Seam
  • Ajax with JSF
    • Components with ajax support
    • JSF ajax frameworks
      • JSF Avatar
      • Ajax Anywhere
      • Ajax4jsf
      • IceFaces
      • Ajax enabled myFaces components
  • Facelets
    • Replacing jsp markup with xhtml
    • Templating
    • Composite components
    • Static EL Functions
    • Powerful view handler than jsf 1.1
    • No need for tag handlers of jsp
  • JSF IDE Support
    • Oracle JDeveloper
    • Sun Studio Creator
    • JBoss Tools
    • MyEclipse
    • Bea Workshop
    • IBM RSA
  • Introducing Apache MyFaces
    • Open source implementation of JSF
    • Trinidad
    • Tomahawk
    • Orchestra
    • Tobago
  • Future
    • JSF 2.0
    • More powerful IDE support
    • More components
    • Facelets
    • Integrated Ajax Support
  • The End - Questions?
    • [email_address]
    • [email_address]
    • www.prime.com.tr/cagataycivici