Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/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 如何在地址栏中显示欢迎文件的完整页面URL_Jsf_Url_Jsf 2_Welcome File - Fatal编程技术网

Jsf 如何在地址栏中显示欢迎文件的完整页面URL

Jsf 如何在地址栏中显示欢迎文件的完整页面URL,jsf,url,jsf-2,welcome-file,Jsf,Url,Jsf 2,Welcome File,我有/pages/index.xhtml页面。问题是,当我运行应用程序时,这个索引页名称不会出现在地址栏上 它只显示http://localhost:8080/myApplication/. 我想看到的是http://localhost:8080/myApplication/pages/index.xhtml 有什么解决办法吗 这是我的欢迎文件,来自web.xml <welcome-file-list> <welcome-file>pages/index.xht

我有/pages/index.xhtml页面。问题是,当我运行应用程序时,这个索引页名称不会出现在地址栏上

它只显示http://localhost:8080/myApplication/. 我想看到的是http://localhost:8080/myApplication/pages/index.xhtml

有什么解决办法吗

这是我的欢迎文件,来自web.xml

<welcome-file-list>
    <welcome-file>pages/index.xhtml</welcome-file>
</welcome-file-list>

您需要从/to/pages/index.xhtml发送重定向。最简单的方法是使用带有元刷新头的真实索引文件

首先创建一个/index.xhtml文件,如下所示:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Dummy homepage</title>
    <meta http-equiv="refresh" content="0; url=pages/index.xhtml" />
  </head>
</html>
<welcome-file>index.xhtml</welcome-file>
然后按如下方式更改您的密码:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Dummy homepage</title>
    <meta http-equiv="refresh" content="0; url=pages/index.xhtml" />
  </head>
</html>
<welcome-file>index.xhtml</welcome-file>
这也会立即修复你糟糕的使用方式。它不应该指定主页,但应该指定文件夹自己的文件,当URL中请求像/或/foo/这样的文件夹而不是文件时,需要提供该文件

另见
您需要从/to/pages/index.xhtml发送重定向。最简单的方法是使用带有元刷新头的真实索引文件

首先创建一个/index.xhtml文件,如下所示:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Dummy homepage</title>
    <meta http-equiv="refresh" content="0; url=pages/index.xhtml" />
  </head>
</html>
<welcome-file>index.xhtml</welcome-file>
然后按如下方式更改您的密码:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Dummy homepage</title>
    <meta http-equiv="refresh" content="0; url=pages/index.xhtml" />
  </head>
</html>
<welcome-file>index.xhtml</welcome-file>
这也会立即修复你糟糕的使用方式。它不应该指定主页,但应该指定文件夹自己的文件,当URL中请求像/或/foo/这样的文件夹而不是文件时,需要提供该文件

另见