adsense


Showing posts with label JAVA SERVER FACES USING ANNOTATION PAGE 28. Show all posts
Showing posts with label JAVA SERVER FACES USING ANNOTATION PAGE 28. Show all posts

Monday, 30 November 2015

JAVA SERVER FACES USING ANNOTATION

COMPUTER LANGUAGES HTML,C,C++.JAVA,.NET AND MULTIMEDIA basics and programs click home button



JAVA SERVER FACES USING ANNOTATION





Using Annotation 


@ManagedBean(name = "helloWorld", eager = true) 
@RequestScoped 
public class HelloWorld { 
  
   @ManagedProperty(value="#{message}") 
   private Message message; 

@ManagedBean Annotation 


@ManagedBean marks a bean to be a managed bean with 
the name specified in name attribute. If the name 
attribute is not specified, then the managed bean 
name will default to class name portion of the fully 
qualified class name. In our case it would be helloWorld. 
Another important attribute is eager. If eager="true" 
then managed bean is created before it is requested 
for the first time otherwise "lazy" initialization is 
used in which bean will be created only when it is requested.