adsense


Showing posts with label JAVA SERVER FACES CREATE A MANAGED BEAN PAGE 22. Show all posts
Showing posts with label JAVA SERVER FACES CREATE A MANAGED BEAN PAGE 22. Show all posts

Sunday, 29 November 2015

JAVA SERVER FACES CREATE A MANAGED BEAN

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



JAVA SERVER FACES CREATE A MANAGED BEAN





Create a Managed Bean 


Create a package structure under src < main < java as com < 
tutorialspoint < test . Create HelloWorld.java class in this package. 
Update the code of HelloWorld.java as shown below. 

package com.tutorialspoint.test; 
 
import javax.faces.bean.ManagedBean; 
 
@ManagedBean(name = "helloWorld", eager = true) 
public class HelloWorld { 
   public HelloWorld() { 
      System.out.println("HelloWorld started!"); 
   } 
   public String getMessage() { 
      return "Hello World!"; 
   } 
}