我想从jsp中调用来自href tag
的动作类,并将对象列表发送到另一个JSP页面。我得到了isshu,数据无法在jsp页面上显示我在struts2中编写以下代码并使用以下注释
这是我的jsp页面,我想在其中调用action class
<li>
<a href="<s:url action='getallfranchiseax' />">View Executive List</a>
</li>
下面给出了Action类,其中方法返回To CLASS中的数据列表
@Namespace("/Franchise")
@ResultPath(value="/")
public class FranchiseRegistrationAction extends ActionSupport implements ModelDriven<FranchiseRegistrationTO>
{
FranchiseRegistrationTO franchiseRegistrationTO=new FranchiseRegistrationTO();
@Action(value="getallfranchiseax", results={
@Result(name="success", type="redirect" ,location="/Franchise/ExecutiveList.jsp"),
@Result(name = "error", location = "/Franchise/FranchiseDashbord1.jsp"),
@Result(name="login", type="redirect",location="/LogIn/LogIn.jsp?target=login-section")
})
public String getAllfranchiseEx() {
FranchiseRegistrationService franchiseRegistrationService=new FranchiseRegistrationServiceImpl();
List<FranchiseRegistrationTO> franchiseRegistrationTO=franchiseRegistrationService.getAllfranchiseExService();
//System.out.println("----->"+franchiseRegistrationTO);
return SUCCESS;
}
}
下面给出了Jsp页面,以重定向 Executive.jsp 页面中的TOs值。
<form action="getAllfranchiseEx" method="post" id="serviceForm">
<div class="card-content">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover"
id="dataTables-example">
<thead>
<tr>
<th>Full Name</th>
<th>Phone Number</th>
<th>Email Id</th>
</tr>
</thead>
<tbody>
<tr class="odd gradeX">
<div class="box-footer">
<ul class="mailbox-attachments clearfix" id="imgli">
<s:iterator value="franchiseRegistrationTO"
status="status">
<td><s:property value="fullName" /></td>
<td><s:property value="contactno1" /></td>
<td><s:property value="emailId" /></td>
</s:iterator>
</ul>
</div>
</tbody>
</table>
</div>
</div>
</form>