在我们的环境中,我有多个上下文(ROOT, myapp, backup)
网址localhost:8080/myapp
& localhost:8080
需要访问相同的应用myapp
为了实现这一点,我正在myapp
目录和tomcat/webapps/ROOT
目录中部署tomcat/webapps/myapp
应用程序。
有没有办法避免这种多重部署?我正在使用apache tomcat 7
答案 0 :(得分:1)
您可以将index.html放在根路径中,将浏览器重定向到您的应用网址:
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=./myapp/">
<script type="text/javascript">
window.location.href = "./myapp/"
</script>
<title>Page Redirection</title>
</head>
<body>
<!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
If you are not redirected automatically, follow the <a href='./myapp/'>link to example</a>
</body>
</html>