It is not problem of Struts or form properties but the encoding of the
parameters.
You may check what is the encoding used to get params from request:
request.getCharacterEncoding()
and chect if it matches your needs and/or the way that characters are
coded by the browser.
If you want to have full control over it:
* specify encoding in your JSPs
<%@ page language="java"
contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8" %>
* use a filter for your application that sets the required encoding
before the request is used by the action:
public void doFilter(...)
HttpServletRequest req = (HttpServletRequest) request;
if (req.getCharacterEncoding() == null) {
req.setCharacterEncoding("UTF-8");
}
chain.doFilter(req, res);
}
Instead of using filter, you may try to configure your app server to
use the required encoding. Tomcat supports it, most likely other app
servers also - but this is app server specific setting.
Regards
Dariusz Wojtas
On 12/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hi,
I have a simple action form where users can enter texts, including special
characters such as German umlauts. If a user enters "müller" in the text field,
I only get "müller" from the actionform. I assume that there is a problem with
the encoding, but I don't know how I can resolve it.
The actionform looks like this:
<html:form action="/test">
<html:text property="text" />
<html:submit>Submit</html:submit>
</html:form>
The Action itself uses a DynaValidatorForm:
DynaValidatorForm f = (DynaValidatorForm) form;
System.out.println(f.getString("text"));
return mapping.findForward(SUCCESS);
Any hints how I can get the right String from the dyna form?
Cheers,
Thorsten