Top "Postconstruct" questions

@PostConstruct is a Java EE annotation used to select a method that needs to be executed after dependency injection is done to perform any initialization.

Session scoped beans and @PostConstruct in JSF

A quite simple and straight-forward question. I have a session scoped managed bean as follows (demonstrating a PrimeFaces range slider). @…

jsf primefaces jsf-2.2 session-scope postconstruct
Testing @Postconstruct with Mockito

Why when I injecting mocks via Mockito my @Postconstruckt method is not calling? @Service public class MyService { public MyService() { System.…

java spring mocking mockito postconstruct
How can I add FacesMessage during page load? Using @PostConstruct does not seem to work

In a backing bean's @PostConstruct method, I make a call to an EJB which might return some messages that I …

jsf message pageload postconstruct
How to resolve JSF1095 Flash Warning "Response already committed" in f:selectItems component?

I meet a strange behavior with JSF 2.4 on Mojarra. I'm using flash parameters to pass from a page to another. …

httpresponse jsf-2.2 postconstruct facescontext flash-scope
@PostConstruct didn't get called by JSF if ManagedBean is inside jar library

I'm running with the following problem. I have a few Managed Beans that are shared between, at this moment, two …

jsf managed-bean postconstruct
JSF injection with managed property, good pattern?

I'm quite new to JSF and not really "used" to the different thinking so I'm struggling on what (I assume) …

jsf design-patterns code-injection managed-bean postconstruct
Spring singleton being called twice

getting some problem into my spring application. I have very fairly simple spring beans, they are injected into various other …

java spring singleton postconstruct
JSF2 preRenderComponent is called always when f:ajax is executed

I have an JSF page backed by NewsBean.java which has <f:event type="preRenderComponent" listener="#{newsBean.init}" /> …

ajax jsf jsf-2 initializer postconstruct
@PostConstruct method is called even if the ManagedBean has already been instantiated (e.g. on AJAX-calls)

I have a @ViewScope ManagedBean and a @PostConstruct initialisation method. This method is called when a new instance is created, …

ajax jsf jsf-2 view-scope postconstruct
How to disable @PostConstruct in Spring during Test

Within a Spring Component I have a @PostConstruct statement. Similar to below: @Singleton @Component("filelist") public class FileListService extends BaseService { …

java spring annotations postconstruct