zoukankan      html  css  js  c++  java
  • @action 注解

    =================================================

    下载 注解配置

     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;
        }

  • 相关阅读:
    MP4文件格式
    ASP.net 学习路线(详细)
    H.264开源解码器评测
    H264编码 封装成MP4格式 视频流 RTP封包
    MP4介绍与基本AVC编码(x264)教程
    创建一个简单的WCF程序
    VUE 从零开始 学习笔记 一
    关于阿里云短信接口的使用
    对Ul下的li标签执行点击事件——如何获取你所点击的标签
    二逼程序员与苦逼程序员
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/4527301.html
Copyright © 2011-2022 走看看