W3C home > Mailing lists > Public > www-validator-cvs@w3.org > September 2005

2002/css-validator/org/w3c/css/servlet CssValidator.java,1.19,1.20

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 08 Sep 2005 12:51:10 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1EDLrz-0007gU-0E@lionel-hutz.w3.org>

Update of /sources/public/2002/css-validator/org/w3c/css/servlet
In directory hutz:/tmp/cvs-serv29505/org/w3c/css/servlet

Modified Files:
	CssValidator.java 
Log Message:
added lang parameter

Index: CssValidator.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/servlet/CssValidator.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- CssValidator.java	8 Aug 2005 13:19:34 -0000	1.19
+++ CssValidator.java	8 Sep 2005 12:51:08 -0000	1.20
@@ -48,12 +48,6 @@
  */
 public final class CssValidator extends HttpServlet {
 
-    private URL htmlURL;
-
-    private boolean auralMode;
-
-    private String returnMode;
-
     final static String texthtml    = "text/html";
 
     final static String textplain   = "text/plain";
@@ -197,7 +191,21 @@
 	int warningLevel = 2;
 	CssParser parser = null;
 
-	ApplContext ac = new ApplContext(req.getHeader("Accept-Language"));
+	String lang = null;	
+	try {
+	    lang = req.getParameter("lang");
+	}
+	catch(Exception e) {
+	    lang = null;
+	}
+	
+	if(lang == null || lang.equals("")) {
+	    lang = req.getHeader("Accept-Language");
+	}
+	else {
+	    lang += ',' + req.getHeader("Accept-Language");
+	}
+	ApplContext ac = new ApplContext(lang);
 	ac.setContentEncoding(req.getHeader("Accept-Charset"));
 	String output = req.getParameter("output");
 	
@@ -240,12 +248,14 @@
 	ac.setMedium(usermedium);
 
 	if (req.getParameter("debug") != null) {
-	    Util.onDebug = req.getParameter("debug").equals("true")
-		|| Util.onDebug;
+	    Util.onDebug = req.getParameter("debug").equals("true");
 	    if (Util.onDebug) {
 		System.err.println("SWITCH DEBUG MODE REQUEST");
 	    }
 	}
+	else {
+	    Util.onDebug = false;
+	}
 
 	text = Util.suppressWhiteSpace(text);
 	uri = Util.suppressWhiteSpace(uri);
@@ -396,7 +406,22 @@
     public void doPost(HttpServletRequest req, HttpServletResponse res)
 	throws ServletException, IOException {
 
-	ApplContext ac = new ApplContext(req.getHeader("Accept-Language"));
+	String lang = null;	
+	try {
+	    lang = req.getParameter("lang");
+	}
+	catch(Exception e) {
+	    lang = null;
+	}
+	
+	if(lang == null || lang.equals("")) {
+	    lang = req.getHeader("Accept-Language");
+	}
+	else {
+	    lang += ',' + req.getHeader("Accept-Language");
+	}
+	ApplContext ac = new ApplContext(lang);
+
 	boolean errorReport = true;
 	int warningLevel = 2;
 	CssParser parser = null;
@@ -415,12 +440,14 @@
 	int len;
 
 	if (req.getParameter("debug") != null) {
-	    Util.onDebug = req.getParameter("debug").equals("true")
-		|| Util.onDebug;
+	    Util.onDebug = req.getParameter("debug").equals("true");
 	    if (Util.onDebug) {
 		System.err.println("SWITCH DEBUG MODE REQUEST");
 	    }
 	}
+	else {
+	    Util.onDebug = false;
+	}
 
 	Util.verbose("\nCssValidator: Servlet request ");
 	// verbose("From " + req.getRemoteHost() +
Received on Thursday, 8 September 2005 12:51:19 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:02:14 UTC