同一JSP调用多个action方法 在同一个JSP上调用多个action,一个action是列出所有不是关联外键的资源(在页面一个table中显示),另一个action则是列出所有关联外键的资源(在另一个table中显示)2个table在同一页面列出。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 第一个Action转向到第二个Action,把数据分别放到两个不同的Request中。最后转向到页面,用循环输出就好了,其实不管有多少个Action,他们都是一体的 页面代码如下:<s:form name="searchForm" id="searchForm" namespace="/course" action="referenceAction!save.action" theme="simple"> <div align="center"> <s:if test="hasFieldErrors()"><s:fielderror/></s:if> <s:if test="hasActionErrors()"><s:actionerror/></s:if> </div> <table width="689" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="689"><img src="/admin/images/2-1-1-01.jpg" width="594" height="86"/></td> </tr> </table> <table id="__01" width="594" height="41" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="3"> </td> </tr> <tr> <td width="11" height="33" background="/admin/images/2-1-1-04.jpg"> </td> <td width="538" height="33" valign="bottom" background="/admin/images/2-1-1-03.jpg" class="tit4"><s:if test="test=obj.courseId==0L">参考资料</s:if> <s:else>修改课程参考资料</s:else></td></td> <td width="45" height="33"><a href="#"><img src="/admin/images/2-1-1-02.jpg" width="45" height="33" /></a></td> </tr> <tr> <td height="0" colspan="3" background="/admin/images/2-1-1-05.jpg"> </td> </tr> </table> <s:if test="test=obj.courseId==0L"></s:if> <s:else> <table> <tr> <td width="150" height="30">已选择参考资料:</td> <td width="140" height="30"></td> <td colspan="3" align="right" class="tit3"><input name="textfield10" type="text" id="textfield10" value="" style="width:195px;height:18px;" onclick="txtOnfocus(this)"/> <input type="button" name="button10" id="button16" value=" 查询 " onclick="doSearch()"/></td> </tr> </table> <table border="0" cellspacing="0" cellpadding="0" class="tab"> <tr> <td width="50" height="30" bgcolor="#F0F0F0" class="tit3">序号</td> <td width="150" bgcolor="#F0F0F0" class="tit3">标题</td> <td width="100" bgcolor="#F0F0F0" class="tit3">创建时间</td> <td width="170" bgcolor="#F0F0F0" class="tit3">类型</td> <td width="50" bgcolor="#F0F0F0"> </td> </tr> <s:iterator id="unRefList" value="unRefList" status="status"> <tr bgcolor="#FFFFFF"> <td height="24"><s:property value="#status.index+1"/></td> <td height="24"><s:property value="#unRefList[0]" /></td> <td height="24"><s:date name="#unRefList[1]" format="yyyy-MM-dd"/><span class="tit8">创建</span><br /> <s:date name="#unRefList[2]" format="yyyy-MM-dd"/><span class="tit8">修改</span></td> <td height="24"><s:property value="#unRefList[3]"/> </td> <td height="24"><fts:permission target="referenceActionUpdate"><input type="submit" name="keys[%{courseId}]"value=" 删除 "></fts:permission></td> </tr> </s:iterator> </table> </s:else> <br/> <table border="0" cellspacing="0" cellpadding="0" class="tab"> <tr> <td width="50" height="30" bgcolor="#F0F0F0" class="tit3">序号</td> <td width="150" bgcolor="#F0F0F0" class="tit3">标题</td> <td width="100" bgcolor="#F0F0F0" class="tit3">创建时间</td> <td width="150" bgcolor="#F0F0F0" class="tit3">类型</td> <td width="50" bgcolor="#F0F0F0"> </td> </tr> <s:iterator id="refList" value="refList" status="status"> <tr bgcolor="#FFFFFF"> <td height="24"><s:property value="#status.index+1"/></td> <td height="24"><s:property value="#refList[0]" /></td> <td height="24"><s:date name="#refList[1]" format="yyyy-MM-dd"/><span class="tit8">创建</span><br /> <s:date name="#refList[2]" format="yyyy-MM-dd"/><span class="tit8">修改</span></td> <td height="24"><s:property value="#refList[3]"/> </td> <td height="24"><fts:permission target="referenceActionUpdate"><input type="submit" name="keys[%{courseId}]"value=" 选择 "></fts:permission></td> </tr> </s:iterator> <tr> <td colspan="5" align="right" bgcolor="#F0F0F0"> <%@include file="../inc/adminPageList.jsp" %> </td> </tr> </table></s:form>求高手帮忙,action中方法都已定义好,调试通过! 我找到解决办法了,只要在action配置文件中配置好action里面跳转另外一个action就可以了 ssh框架下·网站运行第一天正常,第二天来看就报这个错,是为什么? 跪求解决转码问题 正则匹配根据产品id做搜索功能? 问个spring的常识+java基础性问题。。。 Spring +struts 的配置路径问题 有人用java的SNMP4J做过HFC网管软件开发吗?求救! 兄弟们帮忙.JAVA脚本.在线等 jdk 1.5 与 jdk 1.42 严重问题!!!! 自己写的class文件在tomcat5怎么配置.在线等待. 有没有人用过smart gwt 的,求解~ java无符号数据类型的长度 求基于MVC开发的各种应用的设计文档!
<div align="center">
<s:if test="hasFieldErrors()"><s:fielderror/></s:if>
<s:if test="hasActionErrors()"><s:actionerror/></s:if>
</div>
<table width="689" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="689"><img src="/admin/images/2-1-1-01.jpg" width="594" height="86"/></td>
</tr> </table>
<table id="__01" width="594" height="41" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="3"> </td>
</tr>
<tr>
<td width="11" height="33" background="/admin/images/2-1-1-04.jpg"> </td>
<td width="538" height="33" valign="bottom" background="/admin/images/2-1-1-03.jpg" class="tit4"><s:if test="test=obj.courseId==0L">参考资料</s:if>
<s:else>修改课程参考资料</s:else></td></td>
<td width="45" height="33"><a href="#"><img src="/admin/images/2-1-1-02.jpg" width="45" height="33" /></a></td>
</tr>
<tr>
<td height="0" colspan="3" background="/admin/images/2-1-1-05.jpg"> </td>
</tr>
</table>
<s:if test="test=obj.courseId==0L"></s:if>
<s:else>
<table>
<tr>
<td width="150" height="30">已选择参考资料:</td>
<td width="140" height="30"></td>
<td colspan="3" align="right" class="tit3"><input name="textfield10" type="text" id="textfield10" value="" style="width:195px;height:18px;" onclick="txtOnfocus(this)"/>
<input type="button" name="button10" id="button16" value=" 查询 " onclick="doSearch()"/></td>
</tr>
</table>
<table border="0" cellspacing="0" cellpadding="0" class="tab">
<tr>
<td width="50" height="30" bgcolor="#F0F0F0" class="tit3">序号</td>
<td width="150" bgcolor="#F0F0F0" class="tit3">标题</td>
<td width="100" bgcolor="#F0F0F0" class="tit3">创建时间</td>
<td width="170" bgcolor="#F0F0F0" class="tit3">类型</td>
<td width="50" bgcolor="#F0F0F0"> </td>
</tr>
<s:iterator id="unRefList" value="unRefList" status="status">
<tr bgcolor="#FFFFFF">
<td height="24"><s:property value="#status.index+1"/></td>
<td height="24"><s:property value="#unRefList[0]" /></td>
<td height="24"><s:date name="#unRefList[1]" format="yyyy-MM-dd"/><span class="tit8">创建</span><br />
<s:date name="#unRefList[2]" format="yyyy-MM-dd"/><span class="tit8">修改</span></td>
<td height="24"><s:property value="#unRefList[3]"/> </td>
<td height="24"><fts:permission target="referenceActionUpdate"><input type="submit" name="keys[%{courseId}]"value=" 删除 "></fts:permission></td>
</tr>
</s:iterator>
</table>
</s:else>
<br/>
<table border="0" cellspacing="0" cellpadding="0" class="tab">
<tr>
<td width="50" height="30" bgcolor="#F0F0F0" class="tit3">序号</td>
<td width="150" bgcolor="#F0F0F0" class="tit3">标题</td>
<td width="100" bgcolor="#F0F0F0" class="tit3">创建时间</td>
<td width="150" bgcolor="#F0F0F0" class="tit3">类型</td>
<td width="50" bgcolor="#F0F0F0"> </td>
</tr>
<s:iterator id="refList" value="refList" status="status">
<tr bgcolor="#FFFFFF">
<td height="24"><s:property value="#status.index+1"/></td>
<td height="24"><s:property value="#refList[0]" /></td>
<td height="24"><s:date name="#refList[1]" format="yyyy-MM-dd"/><span class="tit8">创建</span><br />
<s:date name="#refList[2]" format="yyyy-MM-dd"/><span class="tit8">修改</span></td>
<td height="24"><s:property value="#refList[3]"/> </td>
<td height="24"><fts:permission target="referenceActionUpdate"><input type="submit" name="keys[%{courseId}]"value=" 选择 "></fts:permission></td>
</tr>
</s:iterator>
<tr>
<td colspan="5" align="right" bgcolor="#F0F0F0">
<%@include file="../inc/adminPageList.jsp" %>
</td>
</tr>
</table>
</s:form>求高手帮忙,action中方法都已定义好,调试通过!