`

struts2 Action跳转到jsp页面css失效的解决办法

 
阅读更多
页面转跳失效问题肯定是路径的问题。建议改相对路径为绝对路径

    String path = request.getContextPath(); 
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 

<link rel="stylesheet" type="text/css" href="<%=basePath%>相对路径/main.css">
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics