Tomcat 7多个上下文

时间:2014-05-26 07:30:51

标签: spring tomcat spring-mvc

我有我的申请" MyApp"在tomcat 7上运行并使用spring框架并具有以下访问URL:

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

我的申请就在路上:

...\tomcat\webapps\MyApp\

我需要更改URL而不更改应用程序文件夹:

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

任何想法?

2 个答案:

答案 0 :(得分:1)

穷人的解决方案:

复制tomcat中的ROOT文件夹并将其重命名为Admin,然后更改index.jsp,将此行添加到代码中:

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

答案 1 :(得分:0)

我更改了我需要的网址:

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