struts中Action跳转jsp页面图片.css乱----解决方法

来源:互联网 发布:产品经理软件 编辑:程序博客网 时间:2024/04/29 07:27

1.struts中的路径用的是action路径,而不是Jsp路径,所以用的时候尽量不要用相对路径,而是用绝对路径

2.使用统一的绝对路径,就是myeclispe中经常用到的<base href="<%=basePath%>">标签

<%String path = request.getContextPath();String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";%><base href="<%=basePath%>">


原创粉丝点击