我有一个父JSP的代码看起来像从包括JSP,我们如何访问另一个声明的变量包括JSP(同父)
<jsp:include page='a.jsp' flush='true'/>
<jsp:include page='b.jsp' flush='true'/>
<jsp:include page='c.jsp' flush='true'/>
a.jsp
有一个Java对象,我需要访问在c.jsp
有没有办法做到这一点,而无需将任何代码从a.jsp移动到父jsp?
这里是a.jsp的样子:
<%@ page import="com.xxx.yyy.myClass" %>
<%
// Some processing here
%>
<table width="100%" cellspacing="0" class="scrollableTable">
<thead>
<tr>
<%
// Some processing here
w_myObject = myAPI.getmyObject(param1, param2);
// Some processing here
%>
</tr>
<!-- Display contents of w_myObject in subsequent rows of this table, here -->
</thead>
</table>
我想访问w_myObject在c.jsp
我的意思是“对象”。 – zeiger 2011-05-03 15:58:08
我用a.jsp的一些代码编辑了这个问题。看一看。谢谢:) – zeiger 2011-05-03 16:06:22