myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r909583 - in /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler: EncodingHandler.java SAXCompiler.java
Date Fri, 12 Feb 2010 19:53:39 GMT
Author: lu4242
Date: Fri Feb 12 19:53:36 2010
New Revision: 909583

URL: http://svn.apache.org/viewvc?rev=909583&view=rev
Log:
MYFACES-2551 Set charset=iso-8859-1 using <f:view> in facelets page makes current page
not being rendered

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/EncodingHandler.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/EncodingHandler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/EncodingHandler.java?rev=909583&r1=909582&r2=909583&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/EncodingHandler.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/EncodingHandler.java
Fri Feb 12 19:53:36 2010
@@ -43,7 +43,18 @@
             ELException
     {
         this.next.apply(ctx, parent);
-        ctx.getFacesContext().getExternalContext().getRequestMap().put("facelets.Encoding",
this.encoding);
+        if (this.encoding == null)
+        {
+            if (!ctx.getFacesContext().getExternalContext().getRequestMap().containsKey("facelets.Encoding"))
+            {
+                ctx.getFacesContext().getExternalContext().getRequestMap().put("facelets.Encoding",
"UTF-8");
+            }
+        }
+        else
+        {
+            //Encoding of document takes precedence over f:view contentType
+            ctx.getFacesContext().getExternalContext().getRequestMap().put("facelets.Encoding",
this.encoding);
+        }
     }
 
 }

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java?rev=909583&r1=909582&r2=909583&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/compiler/SAXCompiler.java
Fri Feb 12 19:53:36 2010
@@ -438,7 +438,7 @@
     {
         CompilationManager mngr = null;
         InputStream is = null;
-        String encoding = "UTF-8";
+        String encoding = null;
         try
         {
             is = new BufferedInputStream(src.openStream(), 1024);
@@ -475,7 +475,7 @@
     {
         CompilationManager mngr = null;
         InputStream is = null;
-        String encoding = "UTF-8";
+        String encoding = null;
         try
         {
             is = new BufferedInputStream(src.openStream(), 1024);
@@ -506,7 +506,7 @@
     protected static final String writeXmlDecl(InputStream is, CompilationManager mngr) throws
IOException
     {
         is.mark(128);
-        String encoding = "UTF-8";
+        String encoding = null;
         try
         {
             byte[] b = new byte[128];
@@ -534,7 +534,7 @@
     protected static final String getXmlDecl(InputStream is, CompilationManager mngr) throws
IOException
     {
         is.mark(128);
-        String encoding = "UTF-8";
+        String encoding = null;
         try
         {
             byte[] b = new byte[128];



Mime
View raw message