- From: Damien Leroy via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 21 Sep 2006 16:01:27 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2006/unicorn/org/w3c/unicorn/tests In directory hutz:/tmp/cvs-serv25605/org/w3c/unicorn/tests Modified Files: FirstServlet.java Log Message: Add use of http method information from the observer contrat to call the observer with method POST or GET. Index: FirstServlet.java =================================================================== RCS file: /sources/public/2006/unicorn/org/w3c/unicorn/tests/FirstServlet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FirstServlet.java 1 Sep 2006 14:30:17 -0000 1.2 +++ FirstServlet.java 21 Sep 2006 16:01:25 -0000 1.3 @@ -125,14 +125,15 @@ mapOfOutputParameter.put("charset", "UTF-8"); mapOfOutputParameter.put("mimetype", "text/html"); final Locale aLocale = aHttpServletRequest.getLocale(); + final UnicornCall aUnicornCall = new UnicornCall(); if (null == aLocale) { mapOfOutputParameter.put("lang", LocalizedString.DEFAULT_LANGUAGE); + aUnicornCall.setLang(LocalizedString.DEFAULT_LANGUAGE); } else { mapOfOutputParameter.put("lang", aLocale.toString()); + aUnicornCall.setLang(aLocale.toString()); } - final UnicornCall aUnicornCall = new UnicornCall(); - aUnicornCall.setLang(mapOfOutputParameter.get("lang").toString()); for ( final Enumeration aEnumParamName = aHttpServletRequest.getParameterNames(); @@ -207,8 +208,15 @@ mapOfOutputParameter.put("format", "xhtml10"); mapOfOutputParameter.put("charset", "UTF-8"); mapOfOutputParameter.put("mimetype", "text/html"); - mapOfOutputParameter.put("lang", LocalizedString.DEFAULT_LANGUAGE); - final Map<String, String[]> mapOfSpecificParameter = new Hashtable<String, String[]>(); + final Locale aLocale = aHttpServletRequest.getLocale(); + if (null == aLocale) { + mapOfOutputParameter.put("lang", LocalizedString.DEFAULT_LANGUAGE); + aUnicornCall.setLang(LocalizedString.DEFAULT_LANGUAGE); + } else { + mapOfOutputParameter.put("lang", aLocale.toString()); + aUnicornCall.setLang(aLocale.toString()); + } + final Map<String, String[]> mapOfSpecificParameter = new Hashtable<String, String[]>(); FileItem aFileItemUploaded = null;
Received on Thursday, 21 September 2006 16:01:35 UTC