I know how to request object while processing a bean method:
@ManagedBean
public class HomeAction {
....
public String getHtmlFormattedCookiesInfo(){
FacesContext facesCtx = FacesContext.getCurrentInstance();
ExternalContext extCtx = facesCtx.getExternalContext();
HttpServletRequest req = (HttpServletRequest) extCtx.getRequest();
....
// now do something with the req object such as read cookie
// or pass req object to another another function
// that knows nothing about JSF
....
}
}
}
But, I don't like putting Faces specific code in my bean object.
Is there a way to pass the request using DI and the faces-config.xml?
Question number 9337433 starts to answer it when you want to pass something that is on the request object. But, I want the entire request object.