我有一個父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