[英]JSF 2.2 inject Deltaspike (CDI) windowId into Bean
I'm currently using JSF 2.2 with Deltaspike. 我目前正在将JSF 2.2与Deltaspike一起使用。 We use the Multi-Window-Handling from Deltaspike to handle separate windows. 我们使用Deltaspike的“多窗口处理”来处理单独的窗口。 It works great but in a specific case, we need the window ID. 效果很好,但在特定情况下,我们需要窗口ID。
I am able to read it with: FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("dswid");
我可以通过以下方式读取它: FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("dswid");
Is there a more elegant way, maybe with injection into my bean? 有没有更优雅的方法,也许是在我的豆子中注入?
Regards, 问候,
Sebastian 塞巴斯蒂安
If you don't want to add a library, you can also inject the external context. 如果您不想添加库,也可以注入外部上下文。
@Inject private ExternalContext externalContext; @Inject private ExternalContext externalContext;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.