【问题标题】:is it possible a htm file in jsf2? [duplicate]jsf2中可能有一个htm文件吗? [复制]
【发布时间】:2016-04-09 03:04:33
【问题描述】:

我正在使用 JSF,我尝试使用文件上传器,但不支持 html 文件。

我的错误是:

org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException:请求不包含 multipart/form-data 或 multipart/mixed 流,内容类型标头为 application/x-www-form-urlencoded ;charset=UTF-8

【问题讨论】:

    标签: jsf file-upload jsf-2


    【解决方案1】:

    你可能错过了enctype="multipart/form-data"

     <form action="..." enctype="multipart/form-data" method="post">
       <p>
       What is your name? <input type="text" name="submit-name"><br>
       What files are you sending? <input type="file" name="files"><br>
       <input type="submit" value="Send"> <input type="reset">
     </form>
    

    参考:https://www.w3.org/TR/html401/interact/forms.html#h-17.13.4.2

    【讨论】:

      猜你喜欢
      • 2011-03-01
      • 2016-12-10
      • 1970-01-01
      • 2010-11-17
      • 2021-04-10
      • 1970-01-01
      • 1970-01-01
      • 2019-10-21
      • 2013-09-05
      相关资源
      最近更新 更多