ITeye博客

struts2.0 action转跳到jsp页面css失效解决方案

andy136566 · 2011-02-14 19:40 · ASIMS经历 · Web前端 · Markdown

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

Java代码 复制代码

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

引用css:

Html代码 复制代码

  1. <link rel="stylesheet" type="text/css" href="<%=basePath%>main.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>main.css">

转:http://jnotnull.iteye.com/blog/198735

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。