I have the follwing setup which works fine:
----------------
search.jsp
----------------
<%@ page language="java" errorPage="error.jsp" %>
...
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page pageEncoding="UTF-8"%>
<%
String search_string = request.getParameter("search_string");
System.out.println("search.jsp: search_string = "+search_string);
%>
...
<html:form action="search.do" enctype="text/plain;charset=UTF-8" >
...
Search:
...
</html:form>
-------------------
but when I do the following (call my search.jsp from another jsp)
----------------
preconfsearch.jsp
----------------
<%@ page language="java" errorPage="error.jsp" %>
...
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ page pageEncoding="UTF-8"%>
<%
String search_string = request.getParameter("search_string");
System.out.println("preconfsearch.jsp: search_string = "+search_string);
%>
...
<jsp:include page="search.jsp">
<jsp:param name="search_string" value="<%=search_string%>"/>
</jsp:include>
-------------------
I have some encoding problems:
preconfsearch.jsp: search_string = cÃble
search.jsp: search_string = cÃÂble
with:
RESPONSE character encoding= ISO-8859-1
REQUEST character encoding= null
JVM encoding UTF-8
then I tried to add a "set Encoding Filter" as follows:
----------------
web.xml
----------------
...
<filter-name>Set Character Encoding</filter-name>
<filter-class>filters.SetCharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<filter-mapping>
<filter-name>Set Character Encoding</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
...
----------------
but then I get:
preconfsearch.jsp: search_string = cÃble
search.jsp: search_string = c?ble
with:
RESPONSE character encoding= ISO-8859-1
REQUEST character encoding= UTF-8
JVM encoding UTF-8
why is this happening and why is my response encoding not set to UTF-8?
thank you for your help,
-Eric
p.s. By the way, I am using a postgres DB with a buch of accented characters and have
no problem rendering them... (my db is initialized with UTF-8 as well)
<a
href="http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3824550#3824550">View
the original post</a>
<a
href="http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3824550>Reply
to the post</a>
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user