2015-12-18 29 views
0

我想重定向到我的tomcat7應用參數, 我想一個鏈接到我的應用程序爲:http://my_IP/newpath/重定向在tomcat7

我創建ROOT.xml/conf/Catalina/localhost有:

<Context 
deployOnStartup="true" 
docBase="/path/in/linux/tomcat7/webapps/MyAppName/" 
path="/newpath" 
debug="0" 
reloadable="true" 
/> 

(在MyAppName文件夾中有index.html文件。)

問題: 我的應用程序需要調用正確使用:

../MyAppName/index.html#/main/../MyAppName/#/main/

我嘗試過,沒有成功:

  • 調用webapps/MyAppName.war
  • 將在ROOT.xml類似: .../MyAppName/index.html#/main/.../MyAppName/index.html%23/main/

我劬est這個'#'號有問題, 以及我讀到我應該重定向到子文件夾(?) 有什麼建議嗎? 預先感謝您:)

回答

0

我已經找到了解決辦法,不是很優雅,但工作:

在/path/in/linux/tomcat/conf/server.xml我已經添加內容上述

在/ MyAppName /我已經添加了新的文件: go.html在我添加了原始的index.html指數HTML 的內容,在頭部分:

<meta http-equiv="refresh" content="0; url=http://my_IP/newpath/go.html#/main/" /> 

我知道,在<meta>中重定向頭不建議。

所有功能和鏈接都在我的應用程序中工作。

+0

*在_meta_中重定向_head_ – pearinthemountains