Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.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
Html 在href中使用env变量_Html_Xhtml - Fatal编程技术网

Html 在href中使用env变量

Html 在href中使用env变量,html,xhtml,Html,Xhtml,我有以下.xhtml文件 <h:body> You have been logged out. Click here <a href="http://mytestserver.com/MyApp/HomePage.jsf">Login</a> to logon again. </h:body> 您已注销。单击此处再次登录。 现在是不同的测试和生产。所以我使用env变量 我的网址=http://mytestserver.

我有以下.xhtml文件

<h:body>
        You have been logged out. Click here <a href="http://mytestserver.com/MyApp/HomePage.jsf">Login</a>   to logon again.  
</h:body>

您已注销。单击此处再次登录。
现在是不同的测试和生产。所以我使用env变量 我的网址=http://mytestserver.com/MyApp/HomePage.jsf 我的网址=http://myprodserver.com/MyApp/HomePage.jsf


如何在此处引用我的URL min href

正如注释所建议的,只需使用相对路径即可:

<h:body>
    You have been logged out. Click here <a href="/MyApp/HomePage.jsf">Login</a>   to logon again.  
</h:body>

您已注销。单击此处再次登录。

问题解决了,您可以在您喜欢的任何服务器上托管它,不需要变量。

您不能只使用相对url
/MyApp/HomePage.jsf
,而不依赖某个变量吗?