帮助需要使用 Struts 2 传递参数。
<action name="Hfddisp1" class="model.HfddispAction" method="fetch_addesc">
<result >model.HfddispAction?ad_ref_no=${ad_ref_no}</result>
</action>
我的jsp是
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
</head>
<body>
<h1> Iterator tag example 12</h1>
<h3>Iterator with IteratorStatus 12</h3>
<table>
<tr class="even">
<td><b>Ad_ref_no</b></td>
<td><b>Ad_title</b></td>
</tr>
<s:iterator value="hftbList" status="hftbListStatus">
<tr>
<s:if test="#hftbListStatus.even == true">
<td style="background: #CCCCCC"><s:property value="ad_ref_no" /> </td>
<td style="background: #CCCCCC"><s:property value="ad_title" /> </td>
<td style="background: #CCCCCC">
<a href="<s:url action="Hfddisp1"/>">click here-1 </a>
</td>
</s:if>
<s:else>
<td>
<s:property value="ad_ref_no" />
</td>
<td>
<s:property value="ad_title" />
</td>
<td >
<a href="<s:url action="Hfddisp2"/>
<s:param name="ad_ref_no" value="% {ad_ref_no}" /> ">
click here2
</a>
</td>
</s:else>
</tr>
</s:iterator>
</table>
我得到的错误是:
消息:没有为动作模型定义结果。HfddispAction 和结果大量测试在这里我可以说它是什么
文件:file:/E:/Web_workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Gshax/WEB-INF/classes/struts.xml
我在迭代器中获取数据,但无法在另一个页面中显示它。
<--------qry is executed2hftb_add_master[ad_ref_no=huge volume of test goes here i can say what is it,email_address=null]
<--------qry is executed2huge volume of test goes here i can say what is it
description successfully queried:1 huge volume of test goes here i can say what is it
Apr 26, 2012 12:07:04 PM org.apache.struts2.dispatcher.Dispatcher serviceAction
SEVERE: Could not find action or result
从第一页我得到的输出是
Ad_ref_no Ad_title
12123120 i am the king but not sing click here-1
213421123 new test1 click here-2
4150 Ad_title ........11:32:08 click here-1
4152 Ad_title ........11:32:09 click here-2
4153 Ad_title ........11:32:10 click here-1
当我单击单击此处-1时,我收到上述错误我正在尝试的只是将 AD REF NO 4150 传递给操作并在另一页中显示描述