I have a Java EE 7 project with a web frontend and I'd like to present some lazily-initialized initial choice to the user which he_she can then complement. The @PostConstruct
method of the EJB seemed like a good place, but it doesn't guarantee that a transaction is present.
I'm looking for the most elegant solution, eventually a place which has been foreseen for this task.
The @PostConstruct
method of an @ApplicationScoped
managed bean in the web frontend would be an option, but I'd still have to make a bogus call to get it initialized - it's way, but maybe not the most elegant one.