标签:extend 路径 reg http class uid ret play image
今天做个小项目,用的是ssh,结果在运行的时候出现HTTP Status 404 - No result defined for action and result input的错误。
首先认真检查所有的配置文件,命名空间,路径,名称都没问题。
于是各种查资料,最后发现,是validate校验器搞的鬼。
分析:
因为我把方法都写在RegisterAction,而检验器文件名为RegisterAction-validation.xml,就是对RegisterAction里的所有方法都起作用,以至于后面我每次查询所有结果时,即调用getAllRegister()方法时, 出现No result defined for action and result input的错误。
后来改成RegisterAction-addRegister-validation.xml,即只对addRegister方法起校验。
问题解决。
package sshlab10.s2h.action; import java.util.List; import sshlab10.s2h.dao.HibernateDao; import sshlab10.s2h.dao.impl.HibernateDaoImpl; import sshlab10.s2h.entity.Register; import com.opensymphony.xwork2.ActionSupport; import com.opensymphony.xwork2.ModelDriven; public class RegisterAction extends ActionSupport implements ModelDriven{ /** * */ private static final long serialVersionUID = 1L; private String password2; private Register register; private List<Register> users; private HibernateDao hibernateDao; public RegisterAction() { register=new Register(); hibernateDao=new HibernateDaoImpl(); } public String getPassword2() { return password2; } public void setPassword2(String password2) { this.password2 = password2; } public List<Register> getUsers() { return users; } public void setUsers(List<Register> users) { this.users = users; } public String getAllRegister() { users=hibernateDao.getAllRegister(); return "show"; } public String addRegister() { hibernateDao.addRegister(register); return SUCCESS; } @Override public Object getModel() { // TODO Auto-generated method stub return register; } }
总结:
s2h-HTTP Status 404 - No result defined for action and result input错误解决
标签:extend 路径 reg http class uid ret play image
原文地址:http://www.cnblogs.com/wzs5800/p/7853093.html