- From: Thomas Gambet via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 24 Sep 2009 15:33:51 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/src/org/w3c/unicorn/action In directory hutz:/tmp/cvs-serv29515/src/org/w3c/unicorn/action Modified Files: IndexAction.java Log Message: small changes.. Index: IndexAction.java =================================================================== RCS file: /sources/public/2006/unicorn/src/org/w3c/unicorn/action/IndexAction.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- IndexAction.java 22 Sep 2009 08:57:35 -0000 1.20 +++ IndexAction.java 24 Sep 2009 15:33:49 -0000 1.21 @@ -5,6 +5,7 @@ package org.w3c.unicorn.action; import java.io.IOException; +import java.io.PrintWriter; import java.util.ArrayList; import java.util.Enumeration; import java.util.Map; @@ -13,8 +14,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +//import org.apache.commons.logging.Log; +//import org.apache.commons.logging.LogFactory; import org.apache.velocity.VelocityContext; import org.w3c.unicorn.Framework; import org.w3c.unicorn.util.Language; @@ -26,12 +27,12 @@ private static final long serialVersionUID = 599055553694915687L; - private static Log logger = LogFactory.getLog(IndexAction.class); + //private static Log logger = LogFactory.getLog(IndexAction.class); private VelocityContext velocityContext; @Override - protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { + public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { if (!Framework.isUcnInitialized) { Framework.init(); @@ -56,7 +57,6 @@ } else { lang = getLanguage((String) req.getParameter(paramPrefix + "lang"), req, messages); task = getTask((String) req.getParameter(paramPrefix + "task"), null); - } if (req.getAttribute("unicorn_messages") != null) { @@ -119,13 +119,13 @@ } } + PrintWriter writer = resp.getWriter(); if (req.getHeader("X-Requested-With") != null && req.getHeader("X-Requested-With").equals("XMLHttpRequest")) { - Templates.write("parameters.vm", velocityContext, resp.getWriter()); - resp.getWriter().close(); + Templates.write("parameters.vm", velocityContext, writer); } else { - Templates.write("index.vm", velocityContext, resp.getWriter()); - resp.getWriter().close(); + Templates.write("index.vm", velocityContext, writer); } + writer.close(); } @Override
Received on Thursday, 24 September 2009 15:34:02 UTC