Hi,
I want to upload file on server from stand-alone application (using
HTTPURLConnection). But when I run stand-alone application which uploads file,
I get following exception on server:
-------------------------------------------------------------------------------------------------------------------------------------------
WARNING: Parameters: Character decoding failed. Parameter skipped.
java.io.CharConversionException: isHexDigit
at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:88)
at org.apache.tomcat.util.buf.UDecoder.convert(UDecoder.java:49)
at org.apache.tomcat.util.http.Parameters.urlDecode(Parameters.java:410)
at
org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:392)
at
org.apache.tomcat.util.http.Parameters.processParameters(Parameters.java:344)
at
org.apache.catalina.connector.Request.parseParameters(Request.java:2453)
at
org.apache.catalina.connector.Request.getParameterNames(Request.java:1073)
at
org.apache.catalina.connector.Request.getParameterMap(Request.java:1053)
at
org.apache.catalina.connector.RequestFacade.getParameterMap(RequestFacade.java:414)
at
javax.servlet.ServletRequestWrapper.getParameterMap(ServletRequestWrapper.java:166)
at
org.apache.struts2.dispatcher.mapper.DefaultActionMapper.handleSpecialParameters(DefaultActionMapper.java:351)
at
org.apache.struts2.dispatcher.mapper.DefaultActionMapper.getMapping(DefaultActionMapper.java:311)
-------------------------------------------------------------------------------------------------------------------------------------------
It seems struts2 filter tries to retrieve parameters from request. I am
directly writing file content which are byte array on output stream of url
connection.
One workaround I found is to bypass the upload request from struts2 filtering.
But this approach is not good because my entire web application is struts based.
Is there any way to upload file through strut itself?
Thanks,
Rupesh
DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the
property of Persistent Systems Ltd. It is intended only for the use of the
individual or entity to which it is addressed. If you are not the intended
recipient, you are not authorized to read, retain, copy, print, distribute or
use this message. If you have received this communication in error, please
notify the sender and delete all copies of this message. Persistent Systems
Ltd. does not accept any liability for virus infected mails.