s2h-HTTP Status 404 - No result defined for action and result input错误解决
今天做个小项目,用的是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错误解决的更多相关文章
- No result defined for action and result input
今天在编程的时候,我遇到了No result defined for action and result input的错误,这个错误想必大家都有遇到过吧,我今天发了很长时间弄这个错误,我以为我的Act ...
- [Struts2] No result defined for action ... and result input & Invalid field value for field ...
"No result defined for action ... and result input"错误一般发生在Struts2的拦截器拦截时遇到了问题时.Struts2会将跳转 ...
- 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的异常,就是在因 ...
- SSH整合报错:No result defined for action and result input
目前发现这个问题主要是在Action中的execute返回值时,没有对应的result name而引起的.很有可能是由于程序执行中出错了,但是对 应的Action中没有添加 input的result ...
- 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,不能够 ...
- no result defined for action
1.no result defined for action .......and result input 或者 no result defined for action .......and ...
- Struts2.3动态调用报 No result defined for action 错误
struts 2.3.16 採用动态调用发现不工作报404 not found,网上查找原因: 1.由于:struts2中默认不同意使用DMI 所以:须要在配置文件里打开: <constant ...
- 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 ...
- Struts 2.x No result defined for action 异常
这是我跑struts2的第一个例子,跑的也够郁闷的,这个问题烦了我几个钟... 2011-5-10 10:10:17 com.opensymphony.xwork2.util.logging.co ...
随机推荐
- TensorFlow系列专题(二):机器学习基础
欢迎大家关注我们的网站和系列教程:http://www.tensorflownews.com/ ,学习更多的机器学习.深度学习的知识! 目录: 数据预处理 归一化 标准化 离散化 二值化 哑编码 特征 ...
- 报错代码:svn-http status413'requset entity too large
报错代码:svn-http status413'requset entity too large 发现报错,判断问题.解决问题.记录问题. SVN服务器端排查过没有问题,其他客户端都能正常更新.只有一 ...
- Linux/CentOS7搭建Anaconda运行环境
1. 安装miniconda 下载并安装miniconda到$HOME/.miniconda/ #从官网下载 wget -c "https://repo.anaconda.com/minic ...
- ASP.NET Core技术研究-探秘Host主机启动过程
当我们将原有ASP.NET 应用程序升级迁移到ASP.NET Core之后,我们发现代码工程中多了两个类Program类和Startup类. 接下来我们详细探秘一下通用主机Host的启动过程. 一.P ...
- Thinking in Java学习杂记(第7章)
将一个方法调用同一个方法主体连接到一起就称为"绑定"(Binding).若在程序运行以前执行绑定,就叫做"早期绑定".而Java中绑定的所有方法都采用后期绑定技 ...
- 200行PYTHON代码实现贪吃蛇
200行Python代码实现贪吃蛇 话不多说,最后会给出全部的代码,也可以从这里Fork,正文开始: 目前实现的功能列表: 贪吃蛇的控制,通过上下左右方向键: 触碰到边缘.墙壁.自身则游戏结束: 接触 ...
- .net core系统跨平台部署手册
前言 .net core跨平台版本基于.net core 3.1 SDK开发,剥离原来的基于MS Office进行文档转换功能的模块,使用基于开源跨平台的LibreOffice进行文档转换的模块.以此 ...
- el-table分页展示数据
<el-table :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)" :show- ...
- [leetcode] 树(Ⅱ)
All questions are simple level. Construct String from Binary Tree Question[606]:You need to construc ...
- PTA数据结构与算法题目集(中文) 7-23
PTA数据结构与算法题目集(中文) 7-23 7-23 还原二叉树 (25 分) 给定一棵二叉树的先序遍历序列和中序遍历序列,要求计算该二叉树的高度. 输入格式: 输入首先给出正整数N(≤50) ...