我试图包含一个listusers.jsp
简单地说“Hello World”的页面。我正在从 profile.jsp 中的参数读取 listusers.jsp 的名称,如下所示。
<!-- profile.jsp -->
<table width="100%" border="0px">
<tr><td>
<table border="0px">
<tr>
<td>
<dsp:a page="profile.jsp">List Users
<dsp:param name="includepage" value="listusers.jsp"/>
</dsp:a>
<dsp:a page="profile.jsp">Shop
<dsp:param name="includepage" value="shop.jsp"/>
</dsp:a>
</td>
</tr>
</table>
</td>
<td>
<dsp:getvalueof param="includepage" id="subpage" >
<dsp:include page="<%= subpage %>" />
</dsp:getvalueof>
</td></tr>
</table>
当我尝试打开时,这给了我以下错误profile.jsp
A:\Tomcat\apache-tomcat-7.0.37\atgbases\ATG\work\Catalina\localhost\MyStore\org\apache\jsp\profile_jsp.java:168: error: method setPage in class IncludeTag cannot be applied to given types;
_jspx_th_dsp_005finclude_005f1.setPage( subpage );
^
required: String
found: Object
reason: actual argument Object cannot be converted to String by method invocation conversion
1 error
1 warning
请让我知道使用包含动态页面的正确方法