@Viewscoped bean does not break when going to another page

I am using @Viewscopedbeans in a JSF 2.1 project. The strange thing is that when I first get the page, the bean is explicitly initialized with all the initial parameters. But when I go to another page, even if I close the browser tab where the te application is open, the bean does not die. When I return to the page using this bean, the values ​​will be the same as those that were changed while using this page. And yet, if I open another browser, such as IE or Chrome, the values ​​are still there! Behaves like a session. Or something like inmortal bean, je.

bean is annotated as follows.

import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import org.springframework.stereotype.Controller;

@Controller
@ManagedBean
@ViewScoped

public class MyBean {
  //the rest of the code.
}

Why is this happening? Maybe an annotation for spring graphics is the cause of the problem?

+3
source share
2

. spring bean. @Controller spring Framework. Singleton, bean, @ManagedBean @ViewScoped, . @Controller @Autowired @ManagedProperty , .

+1

Bean

@ViewScoped
public @Named class MyBean

@PreDestroy .

-2

All Articles