Re: Am I using the action of pretty faces configuration correctly? Advice needed!

Splash Forums PrettyFaces Users Am I using the action of pretty faces configuration correctly? Advice needed! Re: Am I using the action of pretty faces configuration correctly? Advice needed!

#23156

My idea was that you could do something like this:

<url-mapping ...>
<pattern value="/page/#{ template }/whatever" />
....
</url-mapping>

And:

@ManagedBean
@RequestScoped
public class PageController {

@PostConstruct
public void init() {
HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
String templateName = request.getParameter("template")
// create pageinfo stuff
}

}

This way you could use a method annotated with @PostConstruct to do the initialization. This will be done when the bean is first accessed, even if it is before RESTORE_VIEW.