Author: mwringe
Date: 2010-01-19 02:06:40 -0500 (Tue, 19 Jan 2010)
New Revision: 1362
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
Log:
set the request character encoding before accessing any parameters so that the parameters
are encoded properly.
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-01-19
06:37:45 UTC (rev 1361)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2010-01-19
07:06:40 UTC (rev 1362)
@@ -113,6 +113,22 @@
response_ = res;
response_.setBufferSize(1024 * 100);
setSessionId(req.getSession().getId());
+
+
+ //The encoding needs to be set before reading any of the parameters since the
parameters's encoding
+ //is set at the first acces.
+
+ //TODO use the encoding from the locale-config.xml file
+ response_.setContentType("text/html; charset=UTF-8");
+ try
+ {
+ request_.setCharacterEncoding("UTF-8");
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ log.error("Encoding not supported", e);
+ }
+
ajaxRequest_ = "true".equals(req.getParameter("ajaxRequest"));
String cache = req.getParameter(CACHE_LEVEL);
if (cache != null)
@@ -145,17 +161,6 @@
accessPath = PRIVATE_ACCESS;
}
- //TODO use the encoding from the locale-config.xml file
- response_.setContentType("text/html; charset=UTF-8");
- try
- {
- request_.setCharacterEncoding("UTF-8");
- }
- catch (UnsupportedEncodingException e)
- {
- log.error("Encoding not supported", e);
- }
-
urlBuilder = new PortalURLBuilder(requestURI_);
}
Show replies by date