Refine search
@ManagedBean @ViewScoped public class HelloWorldBean { public String getHello() { return "Hello from PrimeFaces and Spring Boot!"; } }
@Named @ViewScoped public class CarsView implements Serializable { private static final long serialVersionUID = 1L; @Autowired private CarRepository carRepository; private List<Car> cars; @PostConstruct public void init() { cars = carRepository.findAll(); } public List<Car> getCars() { return cars; } }
@ViewScoped public class ViewScopedClass { }
@ViewScoped @ManagedBean public class ViewScopedBean implements Serializable { private static final long serialVersionUID = 1L; private int counter = 1; public int getCounter() { return counter++; } public void setCounter(int counter) { this.counter = counter; } }
@ViewScoped public class ViewScopedClass { }
@ManagedBean (eager = true) @ViewScoped public class IcefacesBeanDestroyRecorder implements Serializable { private boolean disposed; public IcefacesBeanDestroyRecorder() { } @PreDestroy public void dispose() { disposed = true; } public boolean isDisposed() { return disposed; } }
@ViewScoped public class ViewScopedClass { }
@ViewScoped @ManagedBean public class ViewScopeContainsSessionScope { @Autowired SpringSessionScopedBean springBean; public int getCounter() { return springBean.getCounter(); } @PostConstruct private void init() { ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); ServletContext servletContext = (ServletContext) externalContext.getContext(); WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext). getAutowireCapableBeanFactory(). autowireBean(this); } }
@ViewScoped @ManagedBean public class ViewScopeContainsRequestScope { @Autowired SpringRequestScopedBean springBean; public int getCounter() { return springBean.getCounter(); } @PostConstruct private void init() { ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); ServletContext servletContext = (ServletContext) externalContext.getContext(); WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext). getAutowireCapableBeanFactory(). autowireBean(this); } }
@ViewScoped @ManagedBean public class ViewScopeContainsPrototypeScope { @Autowired SpringPrototypeScopedBean springBean; public int getCounter() { return springBean.getCounter(); } @PostConstruct private void init() { ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); ServletContext servletContext = (ServletContext) externalContext.getContext(); WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext). getAutowireCapableBeanFactory(). autowireBean(this); } }
@ViewScoped @ManagedBean public class ViewScopeContainsAOPSessionScope { @Autowired SpringAOPSessionScopedBean springBean; public String getCounter() { return springBean.getCounter(); } @PostConstruct private void init() { ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); ServletContext servletContext = (ServletContext) externalContext.getContext(); WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext). getAutowireCapableBeanFactory(). autowireBean(this); } }
@ManagedBean @ViewScoped public class HeadManagedBean implements Serializable {
@ManagedBean @ViewScoped public class HeadManagedBean implements Serializable {
@ViewScoped @ManagedBean public class ViewScopeContainsAOPRequestScope { @Autowired SpringAOPRequestScopedBean springBean; public String getCounter() { return springBean.getCounter(); } @PostConstruct private void init() { ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); ServletContext servletContext = (ServletContext) externalContext.getContext(); WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext). getAutowireCapableBeanFactory(). autowireBean(this); } }
@ViewScoped @ManagedBean public class ViewScopeContainsAOPPrototypeScope { @Autowired SpringAOPPrototypeScopedBean springBean; public String getCounter() { return springBean.getCounter(); } @PostConstruct private void init() { ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); ServletContext servletContext = (ServletContext) externalContext.getContext(); WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext). getAutowireCapableBeanFactory(). autowireBean(this); } }
@ManagedBean @ViewScoped public class SmallNumberBean { @Max(10) @Min(50) private int smallNumber = 42; public int getSmallNumber() { return smallNumber; } public void setSmallNumber(int smallNumber) { this.smallNumber = smallNumber; } public void showErrors() { FacesMessage fm = new FacesMessage(FacesMessage.SEVERITY_INFO, "", "The low-priority message is displayed."); FacesContext.getCurrentInstance().addMessage("smallNumberID", fm); fm = new FacesMessage(FacesMessage.SEVERITY_ERROR, "", "This error message is oppressed, although it seems to be more important."); FacesContext.getCurrentInstance().addMessage("smallNumberID", fm); } }
@ManagedBean @ViewScoped public class ConnectionProductionRepoController extends AbstractProductionRepoController {
@ManagedBean @ViewScoped public class ConnectionProductionRepoController extends AbstractProductionRepoController {