今天做个小项目,用的是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;
} }

RegisterAction

总结:

s2h-HTTP Status 404 - No result defined for action and result input错误解决的更多相关文章

  1. No result defined for action and result input

    今天在编程的时候,我遇到了No result defined for action and result input的错误,这个错误想必大家都有遇到过吧,我今天发了很长时间弄这个错误,我以为我的Act ...

  2. [Struts2] No result defined for action ... and result input &amp; Invalid field value for field ...

    "No result defined for action ... and result input"错误一般发生在Struts2的拦截器拦截时遇到了问题时.Struts2会将跳转 ...

  3. Struts2问题,已解决No result defined for action and result input

    struts2.1.8 必须在struts.xml中配置namespace属性 如果你在2.0中一切OK,但是在2.1中确出现了No result defined for action的异常,就是在因 ...

  4. SSH整合报错:No result defined for action and result input

    目前发现这个问题主要是在Action中的execute返回值时,没有对应的result name而引起的.很有可能是由于程序执行中出错了,但是对 应的Action中没有添加 input的result  ...

  5. HTTP Status 404 - No result defined for action com.hebky.oa.classEntity.action.EntitysAction and result input

    在开发中总遇到这个问题,No result defined for action:原因:Action中的属性值为空的时候,Struts2的默认拦截器会报错,但是又找不到input的Result,不能够 ...

  6. no result defined for action

    1.no result defined for action .......and result input    或者 no result defined for action .......and ...

  7. Struts2.3动态调用报 No result defined for action 错误

    struts 2.3.16  採用动态调用发现不工作报404 not found,网上查找原因: 1.由于:struts2中默认不同意使用DMI 所以:须要在配置文件里打开: <constant ...

  8. No result defined for action com.lk.IndexAction and result success

    意图访问一个 /es/index.action 竟然出现: [SAE ] ERROR [05-11 13:54:32] [http-80-5] com.opensymphony.xwork2.util ...

  9. Struts 2.x No result defined for action 异常

      这是我跑struts2的第一个例子,跑的也够郁闷的,这个问题烦了我几个钟... 2011-5-10 10:10:17 com.opensymphony.xwork2.util.logging.co ...

随机推荐

  1. Dropout的前世与今生

    Dropout 是一类用于神经网络训练或推理的随机化技术,这类技术已经引起了研究者们的广泛兴趣,并且被广泛地应用于神经网络正则化.模型压缩等任务.虽然 Dropout 最初是为密集的神经网络层量身定制 ...

  2. 4D

    GIS行业通常将GIS常用的数据产品概括为“4D”,即:DOM(数字正射影像图).DEM(数字高程模型).DLG(数字线划地图).DRG(数字栅格地图).以及复合模式派生数据组成. DOM:数字正射影 ...

  3. Prism 源码解读5-数据绑定和命令

    介绍 WPF本身就支持通知.绑定和命令,实现ViewModel和VIew之间的通讯,但相对来说功能比较少,Prism扩充了这些功能并提供更加强有力,简洁的数据绑定和命令. 0 绑定通知 WPF的绑定通 ...

  4. Blazor入门笔记(6)-组件间通信

    1.环境 VS2019 16.5.1.NET Core SDK 3.1.200Blazor WebAssembly Templates 3.2.0-preview2.20160.5 2.简介 在使用B ...

  5. [apue] apue_db:一个可以充当"注册表"的 key-value 数据库

    apue 最后两章都是通过一个完整的实例来解释一些 linux 功能,第20章就是通过一个数据库实例来解释文件锁的使用, 说实话,当时没兴趣,因为满页都是源码和解析,有点看不下去.但是再拾起来硬着头皮 ...

  6. 1065 A+B and C (64bit) (20分)(水)

    Given three integers A, B and C in [−], you are supposed to tell whether A+B>C. Input Specificati ...

  7. 《综合》MMM集群

    <综合>MMM集群 部署集群基础环境 MySQL-MMM架构部署 MySQL-MMM架构使用 1 部署集群基础环境 1.1 问题 本案例要求为MySQL集群准备基础环境,完成以下任务操作: ...

  8. Vulnhub homeless靶机渗透

    信息搜集 nmap -sP 192.168.146.6 nmap -A -Pn 192.168.146.151 直接访问web服务. 大概浏览一下没发现什么,直接扫描下目录把dirb+bp. BP具体 ...

  9. hicharts中treemap添加超链接

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  10. javascript入门 之 ztree (六 结点的点击和展开/折叠事件)

    1.注意: 测试点击事件时,如果要测试取消选中和追加选中,如果按住ctrl和win键无用,则需要先用鼠标左键按住,然后,在松开左键的前几毫秒按住ctrl键便可! <!DOCTYPE html&g ...