java left logo
java middle logo
java right logo
 

Home arrow Java EE Tips
 
 
Main Menu
Home
Java Tutorials
Book Reviews
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Java Network
Java Forums
Java Blog




Most Visited Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews
Top Rated Tips
Java SE Tips
Java ME Tips
Java EE Tips
Other API Tips
Java Applications
Java Libraries
Java Games
Book Reviews


Statistics
Registered Users: 4088
Java SE Tips: 614
Java ME Tips: 202
Java EE Tips: 183
Other API Tips: 779
Java Applications: 298
Java Libraries: 209
Java Games: 16
Book Reviews:
 
 
 
Managed beans declaration E-mail
User Rating: / 12
PoorBest 

Like many other web frameworks, JSF separates the user interface from the model objects that encapsulate data and application logic. When the HTML user interface is generated with the JSF tags, the JSF framework gets the data from the JavaBean model and sets the state of the UI components that make the HTML form. When the user submits the form, JSF validates the user input. If everything is okay, JSF stores the user input in the JavaBean model and the HTTP request can be forwarded to another page following a navigation rule. If there are validation errors, JSF returns the form with error messages, so that the user can correct the input errors. This sample demonstrates XML fragment contains the declarations related to the JavaBean that is managed by JSF:

Code of the sample bean:

package test;

public class SampleBean implements java.io.Serializable {

    private String _text ;
    public String getText() { return _text ; }
    public void setText(String text) { _text = text; }
    ..........

}
<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_0.dtd">

<faces-config>
  ..........

////////////// a definition of a managed bean, its class and scope:
  <managed-bean>
    <managed-bean-name>sampleBean</managed-bean-name>
    <managed-bean-class>test.SampleBean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>

////////////// the list of managed properties;
////////////// we have the only property - text:    
    <managed-property>
      <property-name>text</property-name>
      <null-value/>
    </managed-property>
    
  </managed-bean>
</faces-config>


 Related Tips

 
< Prev   Next >

Page 1 of 0 ( 0 comments )

You can share your information about this topic using the form below!

Please do not post your questions with this form! Thanks.


Name (required)


E-Mail (required)

Your email will not be displayed on the site - only to our administrator
Homepage(optional)



Comment Enable HTML code : Yes No



 
       
         
     
 
 
 
   
 
 
java bottom left
java bottom middle
java bottom right
RSS 0.91 FeedRSS 1.0 FeedRSS 2.0 FeedATOM FeedOPML Feed

Home - About Us - Privacy Policy
Copyright 2005 - 2008 www.java-tips.org
Java is a trademark of Sun Microsystems, Inc.