I have in a html form a combobox with the name of some streets, one of these streets is "AVOU�STRAAT". When i ask source of this html-page i get for this item:
when i select this value and submit the form and take a look in the set-method of the according Struts ActionForm, the value is set to "AVOU�STRAAT" and that's not "AVOU�STRAAT", so the rest of the processing won't work anymore.
Anybody with an idea or suggestion to solve this irritating problem?
and how dou you examine the value in the corresponding setter in the action form? by logging the value to a file or by setting a breakpoint and debugging the code? remember, logging can cause some trouble regarding the charset, too...
If your using the Bean tags or HTML tags in your iteration set the filter attribute to true. Check out web page for more information.
posted 15 years ago
@Trevor: The option-Tag does not support the filter-Attribute :-(
let's have a look. Examine the characterset you are using to save your files. standard might be iso-8859-1, us-ascii or something like this. Try to save the files in iso-8859-1 (LATIN-1).
use this in your jsp-page:
<%@ page pageEncoding="iso-8859-1" %>
this assures a header to be sent to the client telling the page's character encoding is "iso-8859-1". Some servers will not allow these headers to be sent so you can additionally add this (quite early) to your page's <HEAD>-section:
When sending back the form's content the byte stream encoded by the browser must be interpreted by your application server that builds up the HttpServletRequest-Wrapper including parameters etc. When using Tomcat, you can examine the charset used by reading the file: $CATALINA_BASE/server/lib/catalina.jar$org.apache.catalina.util.CharsetMapperDefault.properties. Dependent on the client's accept-language-request-header the specified charset will be used to build up the Strings.
Information about encoding can also be found here: