jsfcdijsf-2.2wildfly-10deltaspike

JSF 2.2 inject Deltaspike (CDI) windowId into Bean


I'm currently using JSF 2.2 with Deltaspike. We use the Multi-Window-Handling from Deltaspike to handle separate windows. It works great but in a specific case, we need the window ID.

I am able to read it with: FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("dswid");

Is there a more elegant way, maybe with injection into my bean?

Regards,

Sebastian


Solution

  • You can use Param from OmniFaces. I find it more elegant, but it is a third libary.

    @Inject @Param
    private String dswid;