Jsf 如何在地址栏中显示欢迎文件的完整页面URL
我有/pages/index.xhtml页面。问题是,当我运行应用程序时,这个索引页名称不会出现在地址栏上 它只显示http://localhost:8080/myApplication/. 我想看到的是http://localhost:8080/myApplication/pages/index.xhtml 有什么解决办法吗 这是我的欢迎文件,来自web.xmlJsf 如何在地址栏中显示欢迎文件的完整页面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
<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/这样的文件夹而不是文件时,需要提供该文件
另见