struts2 jsp页面的信息无法显示
publicStringquery(){EmployeeVoemployeeVo=newEmployeeVo();//获得员工编号employeeVo.setEmpCod...
public String query() {
EmployeeVo employeeVo = new EmployeeVo();
// 获得员工编号
employeeVo.setEmpCode(empCode);
// 获得员工姓名
employeeVo.setEmpName(empName);
// 初始化Service
IEmployeeManageBs service = new EmployeeManageBs();
// 掉用Service
List employeeList = service.queryByCondition(employeeVo);
if(employeeList!=null){
return "querySuccess";
}else{
return null;
}
}
<action name="QUERY" class="com.zds.emis.employee.action.QueryEmployeeAction" >
<result name="querySuccess">/page/employee/employeeQuery.jsp</result>
</action>
<s:iterator value="employeeList">
<tr>
<td height="18" align="center" bordercolor="#3366CC"
bordercolor="1">
<s:property value="empCode" ></s:property>
</td>
<td align="center" bordercolor="#3366CC" bordercolor="1">
<s:property value="empName" ></s:property>
</td>
<td height="18" align="center" bordercolor="#3366CC"
bordercolor="1">
<s:property value="empAge" ></s:property>
</td>
<td align="center" bordercolor="#3366CC" bordercolor="1">
<s:property value="empPhone" ></s:property>
</td>
</tr>
</s:iterator>
我看过Dao里面的程序了,所查询的东西全都能打印出来,但页面就是不能 把查询的信息显示出来,不知道是不是 employeeList没有传到jsp页面来,还是我显示的代码有问题 展开
EmployeeVo employeeVo = new EmployeeVo();
// 获得员工编号
employeeVo.setEmpCode(empCode);
// 获得员工姓名
employeeVo.setEmpName(empName);
// 初始化Service
IEmployeeManageBs service = new EmployeeManageBs();
// 掉用Service
List employeeList = service.queryByCondition(employeeVo);
if(employeeList!=null){
return "querySuccess";
}else{
return null;
}
}
<action name="QUERY" class="com.zds.emis.employee.action.QueryEmployeeAction" >
<result name="querySuccess">/page/employee/employeeQuery.jsp</result>
</action>
<s:iterator value="employeeList">
<tr>
<td height="18" align="center" bordercolor="#3366CC"
bordercolor="1">
<s:property value="empCode" ></s:property>
</td>
<td align="center" bordercolor="#3366CC" bordercolor="1">
<s:property value="empName" ></s:property>
</td>
<td height="18" align="center" bordercolor="#3366CC"
bordercolor="1">
<s:property value="empAge" ></s:property>
</td>
<td align="center" bordercolor="#3366CC" bordercolor="1">
<s:property value="empPhone" ></s:property>
</td>
</tr>
</s:iterator>
我看过Dao里面的程序了,所查询的东西全都能打印出来,但页面就是不能 把查询的信息显示出来,不知道是不是 employeeList没有传到jsp页面来,还是我显示的代码有问题 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询