jsp:incloud导入的JSP页面出现异常
起初使用<iframe>导入JSP页面没有问题,可是当换成<jsp:incloud>引入JSP页面后,就出现如下异常信息
The Struts dispatcher cannot be found. This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]
org.apache.jasper.JasperException: An exception occurred processing JSP page /index/404error.jsp at line 44
41:
42: <body>
43: <div class="main-top">
44: <jsp:include page="/common/top.jsp"></jsp:include>
45: <!-- <iframe name=AD1000 src="${pageContext.request.contextPath}/common/top.jsp" frameborder=0 class="ifr" scrolling=no height=125></iframe> -->
46: </div>
47: <div class="m_da">
Caused by:
org.apache.jasper.JasperException:
An exception occurred processing JSP page /common/top.jsp at line 35
32: </tr>
33: <tr>
34: <td align="right" valign="middle" height="38" width="1200" style="padding-top: 6px;">
35: <s:if test="#session.nickName != null">
36: 鎮ㄥソ!<s:property value="#session.nickName" />
37: <a href="javascript:;" class="htca" onclick="gotoHref('${pageContext.request.contextPath}/goHome.do');" style="color: #2e6399;">涓汉涓績</a>
38: <font style="font-family: 瀹嬩綋;color: black;">|</font> <a href="javascript:;" class="htca" onclick="gotoHref('${pageContext.request.contextPath}/remoteSwitchPCSet_list.do');" style="color: #2e6399;">杩滅▼寮?鍏虫満璁剧疆</a>
,最后测试发现,只要被引入的JSP页面包含了struts标签,如:<s:debug></s:debug>标签就出现此异常,如果被引入的页面没有使用struts标签,就显示正常
------解决方案--------------------include导入的页面与原页面之间是不相互独立的 就是说逻辑啊 结构之类的会相互影响 你检查一下看
------解决方案--------------------静态导入<%@ include file = "a.jsp" %>//主要用于引入静态页面
动态导入:<jsp:include page="b.jsp" /> // 引入的jsp和本身的jsp页面结合起来编译。
搞清楚这两个的区别,你用的动态导入,可能和原jsp页面代码合并编译的时候出错
------解决方案--------------------是不是有重复的标签引用
例如
<!DOCTYPE html
和
<html xmlns="xxxx">
之类。。
------解决方案--------------------也碰到过,反正我是把重复的,struts导入标签去了就没问题了,就是你引入的页面也taglib 同样一个标签
我的异常网推荐解决方案:An exception occurred processing JSP page,http://www.aiyiweb.com/j2se/33144.html