jsp页面到action出现StackOverflowError
先粘代码action里
public class EmployeeAction extends DispatchAction
public ActionForward queryAll(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws Exception {
List list = employeeService.queryAll();
request.setAttribute("list",list);
return mapping.findForward("list");
}
public ActionForward queryById(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)throws Exception {
System.out.println("11111111111111");
return mapping.findForward("success");
}
public ActionForward delete(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)throws Exception {
System.out.println("22222222222222");
return mapping.findForward("success");
}
list页面
<c:forEach items="${requestScope.list}" var="employee">
<tr>
<td align="center"><c:out value="${employee.id}"></c:out></td>
<td align="center"><c:out value="${employee.name}"></c:out></td>
<td align="center"><c:out value="${employee.sex}"></c:out></td>
<td align="center"><c:out value="${employee.age}"></c:out></td>
<td align="center"><c:out value="${employee.department}"></c:out></td>
<td align="center"><a href="employee.do?method=queryById&id=${employee.id}">修改 </a></td>
<td align="center"><a href="employee.do?method=delete&id=${employee.id}">删除</a></td>
</tr>
</c:forEach>
struts配置文件
<action path="/employee"
type="org.springframework.web.struts.DelegatingActionProxy"
name="employee"
scope="request"
parameter="method">
<forward name="success" path="/success.jsp"/>
<forward name="error" path="/error.jsp"/>
<forward name="list" path="/list.jsp"/>
</action>
spring配置文件
<bean name="/employee" class="action.EmployeeAction">
<property name="employeeService">
<ref bean="employeeService"/>
</property>
</bean>
list页面可以正常显示所有记录,点更改或删除链接进action时抛java.lang.StackOverflowError