0

I'm trying to redirect to my application in tomcat7, I want a link to my app as: http://my_IP/newpath/

I've created ROOT.xml in /conf/Catalina/localhost with :

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

(In MyAppName folder there is index.html file.)

Question: my app needs to be called for correct use:

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

I've tried, without success:

  • calling webapps/MyAppName.war
  • adding in ROOT.xml something like: .../MyAppName/index.html#/main/ and .../MyAppName/index.html%23/main/

I quest there is a problem with this '#' sign, as well I read that I should have redirect to sub-folders (?) Any suggestions? Thank You in advance :)

Hiro_Hamada
  • 149
  • 2
  • 12

1 Answers1

0

I've found a solution, not very elegant, but working:

in /path/in/linux/tomcat/conf/server.xml I've added content as above

in /MyAppName/ I've added new file: go.html with content of index html in original index.html I've added, in head section:

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

I know that redirect in <meta> in head is not advised.

All functionality and links are working in my app.

Mr Lister
  • 45,515
  • 15
  • 108
  • 150