1

I have a bean called indexBean and it has an init method. My bean is set to be ViewScoped.

@PostConstruct
public void init(){
    ...
    System.out.println("entered");
    ...
}

Why the init() method is called twice when I refresh the page?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
rLyLmZ
  • 495
  • 4
  • 21

1 Answers1

2

You may want to add additional informations, e.g. JSF Version. Do you have a JSF @ManagedBean or something else like CDI @named bean. In the latter case, you might run into trouble using different cdi-frameworks, see for instance this

Community
  • 1
  • 1
markus_
  • 480
  • 3
  • 12