Hello Martin,
 I tried your suggestion but there is a difference in my case: The
enctype in my form's declaration is "multipart/form-data" (I have to
support file upload). If I leave it that way, I get the same results
(no greek characters). If I change it to "multipart/form-data;
charset=iso-8859-7", I get a nice exception :(

javax.servlet.ServletException: BeanUtils.populate
        org.apache.struts.util.RequestUtils.populate(RequestUtils.java:497)
        
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
        
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
        org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
        org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.IllegalArgumentException: argument type mismatch
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:585)
        
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1789)
        
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.java:1684)
        
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:1713)
        org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:1019)
        org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
        org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
        
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
        
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
        org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
        org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Any ideas?

Thanks,
Antonis

On 5/29/06, Martin Gainty <[EMAIL PROTECTED]> wrote:
Good Afternoon Antonis-

This character encoding issue has been addressed 
http://issues.apache.org/struts/browse/STR-2117 as follows

Set your page to use correct character encoding
<%@ page ....;contentType="text/html" charset=UTF-8"%>

Set form to use correct form encoding
<html:form action....method...enctype="application/x-www-form-urlencoded; 
charset=UTF-8">

Instruct web container to use selected charset when creating request (in 
server.xml)
<Connector port..URIEncoding="UTF-8".../>

HTH,
Martin --
----- Original Message -----
From: "Antonis Lebesis" <[EMAIL PROTECTED]>
To: <user@struts.apache.org>
Sent: Monday, May 29, 2006 2:07 PM
Subject: multipart/form-data and character encoding


Hi,
 I 've searched the archives but haven't found any solution to my
latest problem. I have with a <html:file> input and a <html:text>
input. The problem is that request.getCharacterEncoding() returns null
and the text input is considered to be in iso-8859-1 encoding. In the
corresponding ActionForm's reset(), I have added the following line:
 request.setCharacterEncoding("ISO-8859-7");

In forms that don't have a <html:file> input, the character set is
correct. The problem occurs only in this form and from what I 've
found it is caused by the fact that in the form declaration I have
added enctype="multipart/form-data".

Has anyone solved this problem?

Thanks,
Antonis

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to