W3C home > Mailing lists > Public > www-validator-cvs@w3.org > August 2009

2006/unicorn/src/org/w3c/unicorn/action IndexAction.java,1.1.2.8,1.1.2.9

From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 17 Aug 2009 09:03:45 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1Mcy81-0003zb-4Q@lionel-hutz.w3.org>
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action
In directory hutz:/tmp/cvs-serv15333/src/org/w3c/unicorn/action

Modified Files:
      Tag: dev2
	IndexAction.java 
Log Message:
added charset=UTF-8 to the response contentType

Index: IndexAction.java
===================================================================
RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/Attic/IndexAction.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -d -r1.1.2.8 -r1.1.2.9
--- IndexAction.java	13 Aug 2009 17:28:34 -0000	1.1.2.8
+++ IndexAction.java	17 Aug 2009 09:03:43 -0000	1.1.2.9
@@ -2,6 +2,7 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Locale;
 
 import javax.servlet.ServletException;
 import javax.servlet.http.HttpServletRequest;
@@ -29,8 +30,8 @@
 	
 	@Override
 	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-		//templateList.clear();
-		resp.setContentType("text/html");
+		resp.setContentType("text/html; charset=UTF-8");
+		req.setCharacterEncoding("UTF-8");
 		
 		// Language negotiation
 		String langParameter = req.getParameter("lang");
@@ -39,12 +40,6 @@
 		
 		velocityContext = new VelocityContext(Language.getContext(langParameter));
 		
-		//Locale lang = LanguageNegociator.negociate(langParameter, req.getLocales());
-		//resp.setLocale(lang);
-		//velocityContext.put("lang", lang.getLanguage());
-		
-		
-		
 		
 		// Contains a message ?
 		/*if (messages == null) {
@@ -104,6 +99,7 @@
 		private static VelocityEngine engine = new VelocityEngine();*/
 		
 		Framework.getTemplate("index").merge(velocityContext, resp.getWriter());
+		resp.getWriter().close();
 		try {
 			//Properties aProperties = new Properties();
 			
Received on Monday, 17 August 2009 09:03:53 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:38 UTC