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
Jsf 无法找到或提供资源/Directory1/Myproject/index.xhtml_Jsf_Navigation - Fatal编程技术网

Jsf 无法找到或提供资源/Directory1/Myproject/index.xhtml

Jsf 无法找到或提供资源/Directory1/Myproject/index.xhtml,jsf,navigation,Jsf,Navigation,我有一个注销功能,可以实现当前会话中用户的注销。此函数可以从位于项目中不同目录的许多不同页面调用。我希望在调用函数后,将用户重定向到索引页。但我无法做到这一点。我知道重定向取决于函数的返回字符串,但这个字符串似乎是指当前目录 例如 其功能是: String logout(){ .. return "Myproject/index.xhtml" } 只要从index.xhtml调用它,它就可以正常工作 然而,当我从page1.xhtml调用它时,它不能处理消息: 无法找到或提供资源/Direct

我有一个注销功能,可以实现当前会话中用户的注销。此函数可以从位于项目中不同目录的许多不同页面调用。我希望在调用函数后,将用户重定向到索引页。但我无法做到这一点。我知道重定向取决于函数的返回字符串,但这个字符串似乎是指当前目录

例如

其功能是:

String logout(){
..
return "Myproject/index.xhtml"
}
只要从index.xhtml调用它,它就可以正常工作

然而,当我从page1.xhtml调用它时,它不能处理消息:

无法找到或提供资源/Directory1/Myproject/index.xhtml

有什么办法可以让这一切顺利进行,或者我应该换一种方式吗?

尝试添加“/”

String注销(){
..
返回“/Myproject/index.xhtml”
}

String logout(){
..
return "Myproject/index.xhtml"
}