又发现rest plugin的一个问题:
DefaultContentTypeHandlerManager:
// Don't return any content for PUT, DELETE, and POST where there are no errors
if (!statusNotOk && !"get".equalsIgnoreCase(req.getMethod())) {
target = null;
}
导致经过正确处理的put和delete请求,无法返回xml/json内容(成功提示等)
间接导致jquery ajax 调用失败(response=null)?
如果可能,如何重写该类(只需将这段屏蔽掉即可)?
http://mail-archives.apache.org/mod_mbox/struts-user/201002.mbox/%3C3d5bf9841002231520u56375851rd0a0ac4f80b6c7b3@mail.gmail.com%3E
http://mail-archives.apache.org/mod_mbox/struts-user/201002.mbox/thread?2
但这个mail仍然没有人回答。。
/////////////////////////////////////////
竟然也有人在这篇文章的末尾弱弱的提问这个问题:
http://raibledesigns.com/rd/entry/go_light_with_apache_struts
终于发现这个问题的确是个bug,在apache的bug列表里面有:
http://issues.apache.org/jira/browse/WW-3303
/////////////////////////////////////////
项目比较着急,没时间继续找办法了。直接修改struts2-rest-plugin 的源代码解决之。
好在只是修改一个插件的代码,并且strut2全部使用maven作为构建工具,直接在源代码中屏蔽掉这段话,然后在rest的根目录mvn clean install,我的程序便能成功运行了,其实这么做也不赖,呵呵。。。
但这样做的前提是我得把所作的修改记下来,不然升级strut2的时候又坏了,除非这个问题在下一个版本中已经更正。还是在这里先提醒一下自己。。。
分享到:
相关推荐
struts2-rest-plugin-2.1.6.jar
以 Convention 插件为基础,Struts 2.1 又新增了 REST 插件,允许 Struts 2 应用对外提供 REST 服务。REST 插件也无需使用 XML 进行配置管理。Struts 2.1 通过 REST 插件完全可以提供让人和机器客户端共同使用的资源...
plugin-2.5.10.1.jar,struts2-pell-multipart-plugin-2.5.10.1.jar,struts2-plexus-plugin-2.5.10.1.jar,struts2-portlet-plugin-2.5.10.1.jar,struts2-rest-plugin-2.5.10.1.jar,struts2-sitegraph-plugin-2.5...
struts2-convention-plugin-2.1.6.jar
将 Struts 2 项目下 struts2-convention-plugin-2.1.6.jar、struts2-rest-plugin-2.1.6.jar 两个 JAR 包复制到 Web 应用的 WEB-INF/lib 路径下。 由于 Struts 2 的 REST 插件还需要将提供 XML、JSON 格式的数据,...
struts插件,放入classpath中即用!
struts2-rest-plugin-2.3.30.jar, struts2-sitegraph-plugin-2.3.30.jar, struts2-sitemesh-plugin-2.3.30.jar, struts2-spring-plugin-2.3.30.jar, struts2-struts1-plugin-2.3.30.jar, struts2-testng-plugin-...
最近温习ssh2整合编程,顺便浏览下struts2有什么更新的消息,下载了新版本的struts2的2.1.8.1版,使用的是MyEclipse8.0开发,但是问题就随之而来了。MyEclipse8.0中自带的struts2版本是2.1.6,spring版本有2.0,2.5...
struts2.1.6 convertion插件(即注释方式配置)的helloworld 默认调用index()方法 文档说明用struts.xml中标签设置值,好象不用也行 rest插件例子 默认调用 ...哪为高手给我说下 rest-plugin有什么好处 项目中有说明文件
A list of available plugins is available at the Struts 2 Plugin Registry. Tired of XML-based configurations, or need some extra agility? Try the Convention Plugin or its RESTful cousin, the REST ...
struts2-rest-plugin-2.5.2.jar, struts2-sitegraph-plugin-2.5.2.jar, struts2-sitemesh-plugin-2.5.2.jar, struts2-spring-plugin-2.5.2.jar, struts2-testng-plugin-2.5.2.jar, struts2-tiles-plugin-2.5.2.jar, ...
Struts2请求转restful所需jar包 ezmorph-1.0.6.jar json-lib-2.3-jdk15.jar struts2-convention-plugin-2.3.14.jar struts2-rest-plugin-2.3.14.jar xstream-1.4.3.jar
NULL 博文链接:https://jackroomage.iteye.com/blog/888807
A list of available plugins is available at the Struts 2 Plugin Registry. Tired of XML-based configurations, or need some extra agility? Try the Convention Plugin or its RESTful cousin, the REST ...
maven-web项目 Struts2 Struts注解 Struts2返回json
struts2-portlet-plugin-2.5.10.jar,struts2-rest-plugin-2.5.10.jar,struts2-sitegraph-plugin-2.5.10.jar,struts2-sitemesh-plugin-2.5.10.jar,struts2-spring-plugin-2.5.10.jar,struts2-testng-plugin-2.5.10....
struts-2.1.8-LIB包 struts2.0JAR包
版本为struts2.1.6,分有两个文件夹,文件夹struts2_must的jar包是必需的,文件夹struts-2.1.6包含所有的jar包。
struts最新资源包,struts-2.1.6
struts2-convention-plugin-2.3.7-...struts2-rest-plugin-2.3.7-sources.jar struts2-spring-plugin-2.3.7-sources.jar xwork-core-2.3.7-sources.jar xwork-core-2.3.8-sources.jar xwork-core-2.3.15.1-sources.jar