- 浏览: 1560472 次
- 性别:
- 来自: 吉林
文章分类
- 全部博客 (624)
- C/C++ (33)
- Java (181)
- 网络相关 (7)
- 我爱篮球 (3)
- 也爱足球 (4)
- 杂谈 (1)
- 系统架构 (3)
- Web Service (14)
- Framework (3)
- 系统命令 (8)
- 管理平台相关 (8)
- 其它 (35)
- Websphere (1)
- Struts2 (24)
- Hibernate (16)
- Spring (23)
- javascript (20)
- jquery (23)
- html/css/div (28)
- 数据库 (40)
- JavaWeb (27)
- 设计模式 (2)
- 文档编写 (3)
- SVN (5)
- Ant (1)
- Maven (13)
- 软件项目管理 (8)
- AOP (1)
- kindeditor (1)
- JSON (2)
- Servlt/JSP (4)
- WordXML (2)
- XML (12)
- 面试相关 (7)
- Tomcat (11)
- 性能与调优 (29)
- 职业发展 (2)
- 操作系统 (7)
- AJAX (2)
- DWR (1)
- Eclipse (12)
- 持续集成 (3)
- 批处理命令 (1)
- Mozilla Rhino (2)
- 新鲜技术 (18)
- Apache mina (2)
- 底层技术 (18)
- Linux (22)
- 新鲜技术,IT历史 (1)
- 敏捷开发 (1)
- 版本控制 (5)
- 较火技术 (7)
- 集群 (2)
- Web前端 (13)
- 报表工具 (3)
- 网站架构 (5)
- 大数据 (8)
- 分布式存储 (5)
- 云计算 (8)
- TCP/IP协议 (1)
- 负载均衡 (3)
- 硬件 (1)
- 表现层技术 (3)
- Velocity (3)
- jvm (6)
- 并发编程 (10)
- hadoop (8)
- 数据结构和算法 (12)
- 计算机原理 (1)
- 测试驱动开发-TDD (3)
- 开发技巧 (1)
- 分词器 (1)
- 项目构建工具 (2)
- JMX (4)
- RMI (1)
- 测试技术 (22)
- 网络完全 (1)
- Git (4)
- apache开源包 (4)
- Java常用 (1)
- mock (2)
- OSGi (2)
- MongoDB (1)
- JBPM (1)
- Storm (3)
- mysql (2)
- telnet (1)
- 正则表达式 (1)
- bootstrap (4)
- Apache ActiveMQ (1)
- redis (9)
- Nginx (2)
- rsync+inotify文件同步 (2)
- testng (1)
- 原型设计工具 (1)
- 工程能力 (1)
- 风险控制 (3)
- ibatis (1)
- 分布式 (4)
- 安全技术 (1)
- 计算机基础 (4)
- 消息中间件 (1)
- UML (2)
最新评论
-
u012236967:
java命令执行jar包(里面的main函数)的方式(包括依赖其它的jar包问题) -
世界尽头没有你:
Selenium自动化测试从入门到精通(Java版)百度网盘地 ...
自动化测试工具 Selenium WebDriver 入门教程(针对主流浏览器) -
小小西芹菜:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
dwr实现Reverse Ajax推送技术的三种方式 -
hellozhouqiao:
楼主,请教一点问题.现在我们需要在excel 的页脚里面加上图 ...
FreeMaker + xml 导出word(处理目录,图片和页眉页脚问题) -
乱在长安:
使用Timer会有各种各样的问题好嘛?!书上推荐使用Sched ...
DelayQueue (ScheduledThreadPoolExecutor调度的实现)
本文章非原创,本文章抄录于http://blog.sina.com.cn/s/blog_850822020100u5ct.html
MyEclipse办法为9.0M1
当在struts.xml中使用chain和redirectAction这两个类型结果的时候,会报检查错误!
Multiple annotations found at this line:
- Undefined actionnamespace
parameter
- Undefined actionName parameter
相信不少朋友会被这个错误折腾的很难受吧,现在说下解决方案,在百度和google上搜了很久,国外网站也看了下,半天都没找到解决方法,后来无意中在apache的网站上看到了struts2 chain的使用说明,仔细读了一下,就想到了一个办法,或许可以解决,于是就测试了一下,发现问题完全解决了,现在来说下一我的解决方法。
chain结果类型有4个属性,分别是:
actionName (default) - the name of the action that will be chained to
namespace - used to determine which namespace the Action is in that we're chaining. If namespace is null, this defaults to the current namespace
method - used to specify another method on target action to be invoked. If null, this defaults to execute method
skipActions - (optional) the list of comma separated action names for the actions that could be chained to
其中actionName和namespace是必不可少的,否则就会报错。所以我在项目中就写成如下形式:
<package name="struts" extends="struts-default" namespace="/bg">
<action name="login" class="loginAction">
<result type="chain">
<param name="actionName">index</param>
<param name="namespace">/bg</param>
</result>
</action>
</package>
但是这么写就有一个问题,我的项目比较简单,不想使用命名空间,于是我就想怎么解决这个问题呢,在看官方文档的时候我发现这么一句话:
A root namespace ("/") is also supported. The root is the namespace when a request directly under the context path is received. As with other namespaces, it will fall back to the default ("") namespace if a local action is not found.
于是我就想,用"/"代替"/bg"不就可以解决问题了么。然后就把代码写成如下形式
<package name="struts" extends="struts-default" namespace="/">
<action name="login" class="loginAction">
<result type="chain">
<param name="actionName">index</param>
<param name="namespace">/</param>
</result>
</action>
</package>
好了说到这里我想大家也都明白了该怎么解决chain和redirectAction这两个类型结果(type-result)报检查错误(validation)的问题了吧!
有多的不对的地方还请大家多多指教!!
本文章非原创,本文章抄录于http://blog.sina.com.cn/s/blog_850822020100u5ct.html
parameter
- Undefined actionName parameter
相信不少朋友会被这个错误折腾的很难受吧,现在说下解决方案,在百度和google上搜了很久,国外网站也看了下,半天都没找到解决方法,后来无意中在apache的网站上看到了struts2 chain的使用说明,仔细读了一下,就想到了一个办法,或许可以解决,于是就测试了一下,发现问题完全解决了,现在来说下一我的解决方法。
chain结果类型有4个属性,分别是:
actionName (default) - the name of the action that will be chained to
namespace - used to determine which namespace the Action is in that we're chaining. If namespace is null, this defaults to the current namespace
method - used to specify another method on target action to be invoked. If null, this defaults to execute method
skipActions - (optional) the list of comma separated action names for the actions that could be chained to
其中actionName和namespace是必不可少的,否则就会报错。所以我在项目中就写成如下形式:
<package name="struts" extends="struts-default" namespace="/bg">
<action name="login" class="loginAction">
<result type="chain">
<param name="actionName">index</param>
<param name="namespace">/bg</param>
</result>
</action>
</package>
但是这么写就有一个问题,我的项目比较简单,不想使用命名空间,于是我就想怎么解决这个问题呢,在看官方文档的时候我发现这么一句话:
A root namespace ("/") is also supported. The root is the namespace when a request directly under the context path is received. As with other namespaces, it will fall back to the default ("") namespace if a local action is not found.
于是我就想,用"/"代替"/bg"不就可以解决问题了么。然后就把代码写成如下形式
<package name="struts" extends="struts-default" namespace="/">
<action name="login" class="loginAction">
<result type="chain">
<param name="actionName">index</param>
<param name="namespace">/</param>
</result>
</action>
</package>
好了说到这里我想大家也都明白了该怎么解决chain和redirectAction这两个类型结果(type-result)报检查错误(validation)的问题了吧!
有多的不对的地方还请大家多多指教!!
本文章非原创,本文章抄录于http://blog.sina.com.cn/s/blog_850822020100u5ct.html
发表评论
-
Struts2与Velocity整合
2014-02-19 17:13 2293转自:http://yjhexy.iteye.com/ ... -
Velocity简介和Velocity与Jsp、Freemarker的对比(java常用的三种表现层技术)
2014-02-19 17:09 1408Velocity 是一个基于java ... -
学习Struts2 jQuery Plugin 3.0(转)(此外还有struts-jquery-grid-tags, showcase等)
2014-01-14 20:04 1327from:http://blog.csdn.net/ld_f ... -
KindEditor上传图片问题
2013-03-19 15:24 3352转自:http://www.cnblogs.com/jav ... -
使用SVN检出Struts Spring Hibernate源码
2013-02-05 16:50 1321Spring Spring源码是由springframewo ... -
Servlet与Struts action线程安全问题分析
2012-08-23 10:22 1146Servlet/JSP技术和ASP、PHP等相比,由于其多线程 ... -
Struts2上传文件过大的反馈处理
2012-08-23 09:42 2357问题描述:前段时间在struts2下做文件上传,当上传大文件时 ... -
Struts2的addActionError() 与addFieldError ()
2012-08-23 09:41 1066addActionError() 与addFieldError ... -
struts2中<s:property value="xx"/>的工作原理
2012-08-20 10:18 1679使用struts2标签的jsp页面中<s:propert ... -
struts2的线程安全(好好看看)(在理解不扎实与测试下自己砸了理解的真理)
2012-08-08 15:57 2910转自:http://japi.iteye.com/blog/4 ... -
struts2下利用json进行文件上传和下载遇到的一些问题(暂时未明白)
2012-07-16 16:52 1280上传文件时:利用jquery的ajaxfileupload异步 ... -
struts2文件下载(使用struts2配置方式和单纯response方式)
2012-07-16 16:43 1842若是使用类似Servlet方式下载,可以通过ServletAc ... -
struts2文件上传(单个文件和多个文件)
2012-07-16 16:38 19291. 文件上传的原理: 表单元素的encty ... -
探究Struts2运行机制:StrutsPrepareAndExecuteFilter 源码剖析 (转)
2012-07-13 15:22 1180作者:niumd blog:http://ari.i ... -
Struts2的StrutsPrepareAndExecutefilter与FilterDispatcher
2012-07-13 15:18 947FilterDispatcher是早期struts2的过滤器, ... -
OGNL遍历list和map以及访问四个范围的属性值
2012-07-11 17:23 2291转自:http://blog.csdn.net/a9529 ... -
struts2拦截器(转)
2012-07-01 13:52 1175转自:http://www.blogjava.ne ... -
struts2工作原理(转)
2012-07-01 13:45 1236读者如果曾经学习 过S ... -
Struts2返回JSON数据的具体应用范例(转)
2012-06-29 09:20 1369早在我刚学Struts2之初 ... -
从源代码角度看Struts2返回JSON数据的原理(转)
2012-06-28 23:30 2030前面一篇文章其实只是介绍了如何在Struts2中返回JSON数 ...
相关推荐
关于struts2 Result的配置,有例子
初学Struts2,写了一个简单的用struts2实现页面跳转的功能。高手勿喷
从jsp页面提交form表单后,在struts.xml中寻找匹配的action。在action中处理完业务后返回,在struts.xml中的result属性中转向到另外一个action。
资源中示例了一个struts2的配置文件中配置的action的result结果为另外一个action的配置,该跳转的过程中是带所有参赛调整的,在另外一个action中可以接受到当前action的所有参数,此配置文件是我日常开发中的经验...
action跳转后的页面接收由上一个ACTION传过来的参数
Struts2 result和type
NULL 博文链接:https://cdxs2.iteye.com/blog/1926350
NULL 博文链接:https://xiongjiajia.iteye.com/blog/1431330
struts2中result类型之redirect,重定向
Struts2 Result类型,整理的非常详细!
NULL 博文链接:https://lishouxinghome.iteye.com/blog/1364946
struts2 跳转类型 result type chain dispatcher redirect redirect action
struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别struts1和struts2的区别...
于是就研究使用Struts2的XSLT result方式来做页面显示。 网上相关的内容非常的少,我也研究了好久才玩转的。一开始总是有一些莫名其妙的问题出现,但最后基本上都是和配置相关的比较多。现在这个例子是整个工程项目...
NULL 博文链接:https://cdxs2.iteye.com/blog/1926357
struts2中result类型之redirectAction
Struts2 jQuery Ajax 单页面增删改查,附带Mysql数据脚本!
页面跳转
Struts 标签 页面跳转 数据库操作 Struts 标签 页面跳转 数据库操作 Struts 标签 页面跳转 数据库操作
在struts2的返回结果配置中,我们大部分情况使用默认的或者chain或者redirect,其实struts2还有很多其他类型的,今天我们就来看一下都有哪些类型。 打开struts2的源码中struts-default.xml文件,我们能看到如下配置