=================================================
下载 注解配置
private String fileName;
private String contentType = "application/octet-stream";
@Action(value = "/download", results = { @Result(name = "download", type="stream",
params={
"contentType","${contentType}",
"inputName","targetFile",
"contentDisposition","attachment;filename=${fileName}"
})
})
xml配置
<package name="fileService" namespace="/service/file" extends='struts-default'>
<action name="download" class="fileAction" method="view">
<result type="stream">
<param name="contentType">${contentType}</param>
<param name="inputName">targetFile</param>
<param name="contentDisposition">filename="${fileName}"</param>
</result>
</action>
<action name="delete" class="fileAction" method="delete">
<result>/result.jsp</result>
</action>
</package>
=================================================
struts-json 配置 参考
http://www.doc88.com/p-994525480794.html
@Controller
@Namespace("help")
@Component
@ParentPackage("json-default") //注意这边要加 json 默认不是json的
public class HotFaqAction extends BaseAction {
private List<FAQinfo> list;
@Reference(version = "1.0.0")
private FAQService fAQService;
/**
* 控件提交 注意这边type要给json 所有的属性都会序列化json 如果不想所有 就要过滤 过滤暂时没研究到
*/
@Action(value = "/helpMsgAddAjax", results = { @Result(name = NONE, type = "json" ) })
public String helpMsgAddAjax() {
list = fAQService.getHot(5, 0);
super.output("true");
return null;
}
相关推荐
注解配置ACTION
package soundsystem; import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired;...import org.springframework....
Struts2的框架及注释和使用法,希望大家支持,我们一起努力,谢谢!
使用注解配置Action示例。里面已经包涵java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils错误异常的解决方案。
Struts 2使用注解配置Action,不配置struts.xml,通过注解直接配置action
SSH框架,下载后导入即可用,不是Maven项目,ssh框架中的action的创建时struts2自己完成的。
struts2注解配置Action及拦截器几种不同方式写法对应的路径指向.docx
本文档为SSH整合开发案例,代码主要包含action、service、dao注解及各种注解的含义,旨在是学习,功能为辅,适合于学习ssh全注解开发的人员下载
spring3 mvc 注解action dao service 实例教程 ,自己收集的。找了很久。。喜欢大家喜欢。
struts2 注解与Action相关的两个Annotation是@Action 和@Actions2)@Action中可指定一个value属性。类似于指定<action name=””/>属性值
使用struts2基于注解(零配置)实现的文件上传与下载的代码,可以正常运行
ssh2注解配置,全部是注解配置,struts2和hibernate3和spring2.5全部是注解配置,,访问路径为http://localhost:8080/mytest/student/findAll.action
使用的是注解的方式完成的,因为注解的方式可以减少一些配置文件,比较方便的。 【特别强调】一定要清楚如何调试项目,因为自己的环境和下载的资源的环境可能不一样,需要修改配置文件或是其他才能正常运行。...
网上很多人想使用注解拦截spring mvc action中的一个方法,实现方法很多,一般是通过在拦截器中分析url路径来实现, 使用自定义注解的方式来标注要拦截的 action 中的某个方法, 没有很好的解决方法, 如果通过借助spring...
很全的ssh全注解环境搭建,各个配置文件,以及dao层,业务层,action控制层
主要介绍了struts2中使用注解配置Action方法详解,涉及一个示例,具有一定参考价值,需要的朋友可以了解下。
基于注解的Action名• 基于注解的拦截机(Interceptor)• 基于注解的命名空间(Nameespace)• 基于注解的XWork包• 默认action以及默认的结果(比如:/products 将会尝试寻找com.example.actions.Products ...
都被它莫名其妙的错误搞的郁闷,而网上关于这方面的东西大多都是基于struts2.0版本的,对我们现在用的2.1以上的版本不起什么作用,所以特整理出一份文档,里面详细说明了怎样用注解出配置struts2的action,...
求有爱的大大帮忙解决一下strut2和sprin3注解找不到action的问题