struts使用

下载文件
     <action name="download" class="thirdIssueAction" method="getDownloadPdf">
            <result name="fileNotFound">/error-404-file.jsp</result>
            <result name="success" type="stream">
          获取输入流的入口,对应action中的 public InputStream getViewInputStream(){} 必须写 <param name="inputName">viewInputStream</param>
          返回浏览器时,浏览器的对应读取方式,,有image/jpg等 <param name="contentType">application/pdf</param>,
          让浏览器,下载文件,fileName为action 属性名
            <param name="contentDisposition"> attachment; filename=${fileName}</param> 
          缓冲区大小
          <param name="bufferSize">1024</param>
            </result>
        </action>

 标签使用

https://blog.csdn.net/q547550831/article/details/53326042

var为当前遍历到的索引,begin end 执行几次  0 - 0 为一次 notices为action测成员属性,,提供get set 方法
<s:iterator value="notices" var="var" begin="0" end="2">
</s:iteraor>

 

输出表达式  可以将request中的值取出
<s:property value="#request.issueTypeStr"/>
  if 的使用(String的判断)
<s:if test='%{#var.ext == "jpg"}'></s:if> (数字的判断) <s:if test='#var。ext == 1'></s:if>

 

 

 

 

转载于:https://www.cnblogs.com/guyuedashu/p/11532513.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值