Hello List,
  I am new here so excuse me if the issue has been already discussed. I
am using Struts1.0.2

I have a probelm with the way the struts handles the multipart message
when the multipart request contains non-ISO-8859-1 characterset (or its
subset like US-ASCII).

I guess the issue about shortcomings of HTTP protocol with detecting character
encoding in which the request is encoded has been discussed here, and
I would rather not go into detail. But the important fact is that to
decode the HTTP request, the programmer need to specify what encoding
the request is encoded in, otherwise, the servlet engine assumes the
request is encoded in ISO-8859-1(If my memory serves, I recall in the
older implementation, it used System character encoding).

Now, when we, non-Latin character set users, would like a string to be sent
from browser to a servlet, we need to call
HttpServletRequest#setCharacterEncoding method to instruct the
HttpServletRequest object what encoding it should use to construct a
String object back from the byte stream sent from the browser.

We do not want the code to set the encoding scatter around our codebases,
so what we usually do is to use the Filter to set character encoding to
the request object.

But, the MultipartIterator class of the struts does not see the requests
character encoding setting and uses ISO-8859-1 charset unconditinally.
It seems there is no way to set the encoding for Multipart Requests. The
multipart message, thus, would be very difficult to use with non-Latin
character sets.

I want your input in followings.

1)  I think it makes sence to use character encoding got from the
request object to encode string part of the multipart message. I would
like to know what other guys think.

2) I downloaded the source package and I wrote a very small patch that
hopefully be useful for non-Latin charset users. However, I could not
compile due to what seems to be the ant version problem. I have never
used xslp task before and it might be a problem with my installation.
Could anyone suggest the solution for this probelm? The error message
starts with

compile.library:
    [style] DEPRECATED - xslp processor is deprecated. Use trax or xalan instead
.
    [style] java.lang.NoClassDefFoundError: com/kvisco/xsl/XSLProcessor
    [style]     at org.apache.tools.ant.taskdefs.optional.XslpLiaison.<init>(Xsl
pLiaison.java:80)
    [style]     at java.lang.Class.newInstance0(Native Method)
    [style]     at java.lang.Class.newInstance(Class.java:237)
    [style]     at org.apache.tools.ant.taskdefs.XSLTProcess.resolveProcessor(XS

.....
I am using Ant 1.5

I am attaching the patch I wrote anyways. But it has not been compiled
and there is no gurrantee that it would. 

Regards.

------------------------
  Yasuhiko SAKAKIBARA
  [EMAIL PROTECTED]

Attachment: MultiPart_Encoding.patch
Description: Binary data

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@;jakarta.apache.org>

Reply via email to