Tomcat 7 multiple contexts

2019-09-09 04:28发布

问题:

I Have My Application "MyApp" that runs on tomcat 7 and use spring framework and have the following access URLs:

1 - https://localhost:8443/MyApp/      for the Application Web
2 - https://localhost:8443/MyApp/Rest  for the Application web services

And my application is sets on the path:

...\tomcat\webapps\MyApp\

I need to change the URLs to be without changing the application folder:

1 - https://localhost:8443/MyApp/Admin       for the Application Web(need to change MyApp to be Admin)
2 - https://localhost:8443/MyApp/Rest  for the Application web services

Any Idea?

回答1:

Poorman's solution:

copy ROOT folder in tomcat and rename it to Admin, then change index.jsp, add this line to code:

response.sendRedirect("https://localhost:8443/MyApp/");


回答2:

i change the URLs that i need:

1 - https://localhost:8443/MyApp/Admin       for the Application Web(need to change MyApp to be Admin)
2 - https://localhost:8443/MyApp/Rest        for the Application web services