<body>
    <html:form action="/jwid/struts1x/15.3/form/upload.do?action=upload" enctype="multipart/form-data">
        文件:<html:file property="file" style="width:200px;"></html:file><br>
        备注:<html:textarea property="text" style="width:200px;"></html:textarea><br><br>
        <html:submit value="开始上传"></html:submit>
    </html:form>
</body>

上传到/WEB-INF/upload之后,文件名是乱码

解决办法:UploadForm.reset()中添加代码:

        try {
            request.setCharacterEncoding("UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }

简单的MVC:UploadForm、UploadAction、upload.jsp

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2021-04-28
  • 2022-12-23
  • 2021-06-29
猜你喜欢
  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2022-12-23
  • 2021-10-19
  • 2021-07-24
相关资源
相似解决方案