今天做个小项目,用的是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. Python python 五种数据类型--列表

    # 列表的定义 var1 = [] var2 = list() print(type(var1)) #<class 'list'> print(type(var2)) #<class ...

  2. 模块 shutil_zipfile_tarfile压缩解压

    shutil_zipfile_tarfile压缩解压 shutil 模块 高级的 文件.文件夹.压缩包 处理模块 shutil.copyfileobj(fsrc, fdst[, length]) #将 ...

  3. [Asp.Net Core] 为什么选择 Blazor Server Side (一) 快速实现图片验证码

    关于Blazor 由于在国内, Blazor一点都不普及, 建议读者翻看我之前写的随笔, 了解Blazor Server Side的特点. 在一段时间内, 我会写一些解说分析型的 "为什么选 ...

  4. [白话解析] 通俗解析集成学习之bagging,boosting & 随机森林

    [白话解析] 通俗解析集成学习之bagging,boosting & 随机森林 0x00 摘要 本文将尽量使用通俗易懂的方式,尽可能不涉及数学公式,而是从整体的思路上来看,运用感性直觉的思考来 ...

  5. 商品spu 和 sku的关系

    总结一下在目前的电商系统中的商品涉及的属性spu,sku.搞清楚两者之间的关系对表的设计非常重要 spu Standard Product Unit (标准产品单位) ,一组具有共同属性的商品集 SK ...

  6. vue 对px 做rem 自动转换

    插件:postcss 安装: npm install postcss-pxtorem vue.config.js 配置 css: { loaderOptions: { postcss: { plugi ...

  7. 对oracle里面clob字段里面xml的增删改查学习

    这段时间,我使用系统表里面有clob字段里面存放的xml信息,我们如何对xml进行增删改查操作呢,自己参考了很多也学到很多,给大家分享一下 首先我们先建测试表 CREATE TABLE EFGP_23 ...

  8. 1014 Waiting in Line (30 分)

    Suppose a bank has N windows open for service. There is a yellow line in front of the windows which ...

  9. c期末笔记(1)

    运算符 1.i++与++i的细微区别 i++与++i 和i++放在一个语句中,则i原本的值先被利用.语句结束后,i的值加一. i的原始值失效,直接加一. 2.int加法 整形数据(int)加上任何类型 ...

  10. 计算机网络协议,IPV4数据报分析

    一.IP数据报结构分析 1.整体结构 一个IP数据报由首部和数据两部分组成. 首部的前一部分固定长20字节,这是所有IP数据报必须具有的:在首部的固定部分后面是一些可选字段,其长度是可变的. IP数据 ...