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

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