zoukankan      html  css  js  c++  java
  • struts2从零开始(四)

    知识点:1、文件上传
              2、类型转换
      

       1、文件上传:
       1.1、 jsp页面代码:
      
    Java代码 复制代码 收藏代码
    1. <body>   
    2.      
    3.           <form action="upload.action" method="post" enctype="multipart/form-data">   
    4.              <input type="file" name="photo">   
    5.              <input type="submit" value="上传">   
    6.                 
    7.           </form>   
    8.      
    9.      
    10.   </body>  


      1.2、 struts.xml中的代码:
      
    Java代码 复制代码 收藏代码
    1. <package name="mypackage" extends="struts-default">   
    2.             
    3.             <action name="upload" class="cn.zhuojingxinxi.web.UploadAction">   
    4.                 <interceptor-ref name="fileUpload"></interceptor-ref>   
    5.                 <interceptor-ref name="defaultStack"></interceptor-ref>   
    6.                          <result name="success">/success.jsp</result>   
    7.                          <result name="input">/error.jsp</result>   
    8.             </action>   
    9.          
    10.          </package>  


  • 相关阅读:
    iOS7's subview trimmed if out of parent view bounds
    iOS 7 — navigationController is setting the contentInset and ContentOffset of my UIScrollView
    友盟统计-页面访问路径
    iOS-Get the NSString height in iOS 7
    php
    How to Install Laravel PHP Framework on CentOS 7 / Ubuntu 15.04
    apache-.htaccess
    ios-member center
    lamp
    mysql
  • 原文地址:https://www.cnblogs.com/bjanzhuo/p/3576022.html
Copyright © 2011-2022 走看看