zoukankan      html  css  js  c++  java
  • 上传图片报错java.lang.IllegalArgumentException: !hex:3b

    2017-08-07 14:49:14 [com.sanqimei.www.common.log.ExceptionLogger:59]-[ERROR] <exception>127.0.0.1|/medicalSpu/addSpu{}|20170807144914</exception>
    java.lang.IllegalArgumentException: !hex:3b
    at org.eclipse.jetty.util.TypeUtil.convertHexDigit(TypeUtil.java:369)
    at org.eclipse.jetty.util.UrlEncoded.decodeUtf8To(UrlEncoded.java:511)
    at org.eclipse.jetty.util.UrlEncoded.decodeTo(UrlEncoded.java:565)
    at org.eclipse.jetty.server.Request.extractParameters(Request.java:331)
    at org.eclipse.jetty.server.Request.getParameter(Request.java:741)
    at com.jfinal.core.Controller.getPara(Controller.java:119)
    at com.sanqimei.www.common.interceptor.ExceptionInterceptor.intercept(ExceptionInterceptor.java:29)
    at com.jfinal.aop.Invocation.invoke(Invocation.java:67)
    at com.jfinal.core.ActionHandler.handle(ActionHandler.java:74)
    at com.jfinal.plugin.druid.DruidStatViewHandler.handle(DruidStatViewHandler.java:75)
    at com.jfinal.ext.handler.ContextPathHandler.handle(ContextPathHandler.java:48)
    at com.jfinal.core.JFinalFilter.doFilter(JFinalFilter.java:74)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
    at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:209)
    at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:244)
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(Servl

    解决办法:

    获取参数param之后,在param后面添加:  param.replaceAll("%(?![0-9a-fA-F]{2})", "%25");

    出现原因:图片在http传输过程当中会出现%,后台接收就会报错。替换之后为题解决。

  • 相关阅读:
    黑客防线
    基于onvif的码流转换专利
    8168开发之---1g内存换成512M的内存映射配置
    图像处理之基础---内积、点积
    3s 简介
    嵌入式开发之工具---比开发手册更重要的一个命令 man page
    图像处理之基础---频域分析
    lbp纹理特征
    28.Docker介绍与目录
    09.客户端集成IdentityServer
  • 原文地址:https://www.cnblogs.com/21heshang/p/7307719.html
Copyright © 2011-2022 走看看