Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/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
Jsf 2 URL重定向JSF_Jsf 2_Prettyfaces - Fatal编程技术网

Jsf 2 URL重定向JSF

Jsf 2 URL重定向JSF,jsf-2,prettyfaces,Jsf 2,Prettyfaces,我有我的应用程序url:127.0.0.1:8080/reader/read.xhtml read.xhtml是通过数据库填充的,并且具有各种 在数据库中硬编码的链接。(read.xhtml实际上是 从数据库中检索为字符串。)例如,有链接 () /write.xhtml /upload.xhtml 因为当我点击它指向的链接时,我无法添加上下文 WWW://127.0.0.1:8080/write.xhtml或 HTTP://127.0.0.1:8080/upload.xhtml 有什么方法可以将

我有我的应用程序
url
127.0.0.1:8080/reader/read.xhtml
read.xhtml
是通过数据库填充的,并且具有各种 在数据库中硬编码的链接。(read.xhtml实际上是 从数据库中检索为字符串。)
例如,有链接
()
/write.xhtml
/upload.xhtml
因为当我点击它指向的链接时,我无法添加上下文
WWW://127.0.0.1:8080/write.xhtml
HTTP://127.0.0.1:8080/upload.xhtml

有什么方法可以将链接重定向到
HTTP://127.0.0.1:8080/reader/write.xhtml

漂亮脸蛋能应付吗。如果是,如何添加?

只需将上下文路径呈现在链接前面,即可将其添加到链接中。比如:

<a href="#{request.contextPath}/#{someBean.linkFromDatabase}">write</a>


无法执行此操作,因为链接是从数据库中获取的。这是一个硬代码,但是你可以使用多个EL表达式来渲染链接。我更新了我的答案。。。