首页 > 技术文章 > tomcat首页跳转

duzhenwen 2020-05-12 18:18 原文

tomcat部署前端项目时,只需要将前端项目放到tomcat/webapps下即可,通过  ip:port/项目名  访问,tomcat的默认端口为8080

在tomcat下部署了前端vue项目,当通过ip:port访问是会跳转到tomcat的首页,将下面代码替换tomcat/webapps/ROOT下的index.jsp页面内容,将使用ip:port访问时会自动跳转到  ip:port/client  项目

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			location.href="/client/"
		</script>
	</head>
	<body>
	</body>
</html>

 

推荐阅读