Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/333.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/jsf/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在jsf/primefaces支持bean中检索url路径_Java_Jsf_Primefaces_Jsf 2.2 - Fatal编程技术网

Java 在jsf/primefaces支持bean中检索url路径

Java 在jsf/primefaces支持bean中检索url路径,java,jsf,primefaces,jsf-2.2,Java,Jsf,Primefaces,Jsf 2.2,假设URL模式为 http://company.com/jsf-app-root/{groupName}/show.xhtml 和实际的URL http://company.com/jsf-app-root/accountant/show.xhtml 如何在支持bean中获取值accountary? 我可以作为构造函数的托管参数或bean的成员 我只找到了查询参数解决方案查询参数解决方案: 或者一些手工工作 FacesContext.getCurrentInstance().getExter

假设URL模式为

http://company.com/jsf-app-root/{groupName}/show.xhtml
和实际的URL

http://company.com/jsf-app-root/accountant/show.xhtml
如何在支持bean中获取值
accountary
? 我可以作为构造函数的托管参数或bean的成员

我只找到了查询参数解决方案查询参数解决方案:

或者一些手工工作

FacesContext.getCurrentInstance().getExternalContext().getRequestPathInfo();
jsf/primeface中真的不支持url路径参数吗

FacesContext.getCurrentInstance().getExternalContext().getRequestContextPath();
检查JavaDocs:


检查JavaDocs:

,如果上下文路径包含多个级别,那么它仍然是maunal工作。丑陋的。感谢您,如果上下文路径包含多个级别,那么它仍然是maunal的工作。丑陋的。谢谢你