Java Mailing List Archive

http://www.junlu.com/

Home » users.myfaces »

Message in @InitView

José Luis Cetina

2012-03-09

Replies: Find Java Web Hosting

Author LoginPost Reply
How can i show an error message when the page load for the first time, this
only work if i go to another page and back to the original (this) then the
message in index.xhml show.

Its possible?

@Named(value="myBean")
@ViewAccessScoped
@Model
@View(Index.class)
public class MyBean implements Serializable{
  @InitView
  public void init(){
     //do something if something its wrong then:
     FacesContext.getCurrentInstance().addMessage(null, new
FacesMessage(FacesMessage.SEVERITY_INFO, "msg", "msg detail"));
  }


Thanks


-------------------------------------------------------------------
*SCJA. José Luis Cetina*
-------------------------------------------------------------------
©2008 junlu.com - Jax Systems, LLC, U.S.A.