在使用action跳转后的页面路径如果是相对路径的话会出现css、js以及图片等无法加载问题。
解决方法:
<% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
在head标签中
<base href="<%=basePath%>">
<% String path = request.getContextPath(); String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %>
<base href="<%=basePath%>">