You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by jw...@apache.org on 2007/11/12 22:03:40 UTC

svn commit: r594297 [4/39] - in /myfaces/trinidad/branches/1.2.4-branch: ./ trinidad-api/ trinidad-api/src/main/java-templates/org/apache/myfaces/trinidad/component/ trinidad-api/src/main/java/org/apache/myfaces/trinidad/bean/ trinidad-api/src/main/jav...

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/conf/META-INF/tr-base.tld
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/conf/META-INF/tr-base.tld?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/conf/META-INF/tr-base.tld (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/conf/META-INF/tr-base.tld Mon Nov 12 13:03:17 2007
@@ -1,346 +1,291 @@
-<?xml version = "1.0" ?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-	   
--->
-<!DOCTYPE taglib 
-   PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
-          "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib>
-  <tlib-version>11-m3</tlib-version>
-  <jsp-version>1.2</jsp-version>
-  <short-name>tr</short-name>
-  <uri>http://myfaces.apache.org/trinidad</uri>
-  <display-name>Apache Trinidad Core</display-name>
-  <listener>
-    <listener-class>org.apache.myfaces.trinidadinternal.webapp.TrinidadListenerImpl</listener-class>
-  </listener>
-        
-    <tag>
-      <name>attribute</name>   
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.AttributeTag</tag-class>
-      <body-content>empty</body-content>
-      <description>
-        The Attribute tag adds a property with the specified name and value 
-        to the component associated with the parent tag.  It behaves the same
-        as the JSF Attribute tag except that it creates a value binding for 
-        expressions instead of immediately evaluating it.  
-      </description>
-      <attribute>
-        <name>name</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the name of the attribute
-        </description>
-      </attribute>
-      <attribute>
-        <name>value</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the value of the attribute
-        </description>
-      </attribute>
-    </tag>
-    
-
-    <tag>
-      <name>validator</name>   
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.ValidatorTag</tag-class>
-      <body-content>empty</body-content>
-      <description>
-        The Validator tag adds a new validator instance to the component
-        associated with the parent tag. The new validator instance is found
-        by evaluating a binding expression, or looking up a validator ID.
-        This implements the JSF 1.2 definition of &lt;f:validator&gt;.
-      </description>
-      <attribute>
-        <name>validatorId</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the ID of a validator instance registered in faces-config.xml
-        </description>
-      </attribute>
-      <attribute>
-        <name>binding</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the value binding expression to a property that returns a
-          ValidatorInstance.
-        </description>
-      </attribute>
-    </tag>        
-
-   <tag>
-      <name>forEach</name>
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.ForEachTag</tag-class>
-      <description>
-The forEach tag is a replacement for the JSTL &amp;lt;c:forEach&amp;gt; tag
-                that works with Apache Trinidad components.  Today, &amp;lt;c:forEach&amp;gt; cannot
-                be used with any JSF components or tags.  This tag brings that functionality
-        to JSF, but it is limited to Apache Trinidad tags. This tag also has several limitations not found in &amp;lt;c:forEach&amp;gt;:
-        &lt;ul&gt;
-        &lt;li&gt;&amp;lt;tr:forEach&amp;gt; does not currently support scenarios where the size of the "items" list or array changes from one request to the next. It may be possible to work around this in specific scenarios by manually deleting all children of the parent component (&amp;lt;tr:selectOneListbox&amp;gt; in the above example), but this has not yet been tested.&lt;/li&gt;
-        &lt;li&gt;&amp;lt;tr:forEach&amp;gt; does not support arbitrary java.util.Collections; it can only iterate over java.util.Lists or arrays.&lt;/li&gt;
-        &lt;li&gt;&amp;lt;tr:forEach&amp;gt; executes at the time the JSP tag executes. So it 
-        does not have access to any EL variables that are created by JSF components.
-        For example, the &amp;lt;tr:table&amp;gt; creates an EL variable using the value of
-        the "var" attribute. However, this EL variable is not available 
-to &amp;lt;tr:forEach&amp;gt;     
-        &lt;/li&gt;
-        &lt;/ul&gt;
-      </description>
-
-      <attribute>
-        <name>items</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the items over which iteration takes place 
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>var</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the name of the variable to expose
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>varStatus</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          Name of the exported scoped variable for the
-          status of the iteration.
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>begin</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the beginning index 
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>end</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the ending index 
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>step</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the number of steps per iteration
-        </description>
-      </attribute>
-
-   </tag>
-
-   <tag>
-      <name>setActionListener</name>
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.listener.SetActionListenerTag</tag-class>
-      <body-content>empty</body-content>
-      <description>
-        The setActionListener tag provides a declarative syntax for assigning values before an action fires
-      </description>
-
-      <attribute>
-        <name>to</name>
-        <required>true</required>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the target for the value;  must be an EL expression
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>from</name>
-        <required>true</required>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the source of the value;  can be an EL expression or a constant value
-        </description>
-      </attribute>
-   </tag>
-
-
-   <tag>
-      <name>fileDownloadActionListener</name>
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.listener.FileDownloadActionListenerTag</tag-class>
-      <body-content>empty</body-content>
-      <description>
-        The fileDownloadActionListener tag provides a declarative syntax for downloading files to a user from a command component.
-      </description>
-
-      <attribute>
-        <name>contentType</name>
-        <required>false</required>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the content or mime type of the file - e.g., text/html or application/pdf
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>filename</name>
-        <required>false</required>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the desired or proposed filename.  If set, the user will typically be presented with a "Save File" dialog, though this is ultimately at the descretion of the user agent.
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>method</name>
-        <required>true</required>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          an EL binding to the method that will deliver the file contents.  The method must take two parameters, a FacesContext and an OutputStream.
-        </description>
-      </attribute>
-   </tag>
-
-
-   <tag>
-      <name>returnActionListener</name>
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.listener.ReturnActionListenerTag</tag-class>
-      <body-content>empty</body-content>
-      <description>
-        The returnActionListener tag is a declarative way to allow an action source to return 
-        a value from a dialog or process.
-      </description>
-
-      <attribute>
-        <name>value</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          The value to return as the dialog/process result.
-          This can be an EL expression or a constant value.
-        </description>
-      </attribute>
-   </tag>
-
-
-   <tag>
-      <name>resetActionListener</name>
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.listener.ResetActionListenerTag</tag-class>
-      <body-content>empty</body-content>
-      <description>
-        The resetActionListener tag provides a declarative syntax for resetting values before an action fires
-      </description>
-   </tag>
- 
-   <tag>
-      <name>componentRef</name>
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.ComponentRefTag</tag-class>
-      <description> 
-
-      The componentRef tag adds declarative components onto the current
-      component tree. The declarative component is usually defined in a jsp
-      file.  It is currently experimental and should not be used by
-      developers.
-
-      </description>
-
-      <attribute>
-        <name>componentType</name>
-        <required>true</required>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-Identifies which declarative component to use. 
-All the available components must be
-declared in a region-metadata.xml file.
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>id</name>
-        <required>true</required>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          This ID must be unique within this page. 
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>value</name>
-        <required>false</required>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          A value to pass to the component definition.
-        </description>
-      </attribute>
-
-      <attribute>
-        <name>rendered</name>
-        <required>false</required>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          Whether or not this component is rendered.
-        </description>
-      </attribute>
-
-   </tag>
-
-
-    <tag>
-      <name>componentDef</name>   
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.ComponentDefTag</tag-class>
-      <description>
-        The componentDef tag is used to define a component. Its primary purpose
-is defining a "var" property so that the definition can refer to attributes
-on this component's usage.
-      </description>
-      <attribute>
-        <name>var</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the variable name to use when referencing attributes, that may be set
-          on this new component.
-        </description>
-      </attribute>
-    </tag>        
-
-
-    <tag>
-      <name>facetRef</name>   
-      <tag-class>org.apache.myfaces.trinidadinternal.taglib.FacetRefTag</tag-class>
-      <description>
-        The facetRef tag is used to copy facets from a component
-        and paste them into its
-        definition. This tag may only be used within an &lt;tr:componentDef&gt;
-        tag.
-        Each facet may be used only once within each 
-        &lt;tr:componentDef&gt;. In other words, a single facet cannot be
-        used more than once.
-      </description>
-      <attribute>
-        <name>facetName</name>
-        <rtexprvalue>false</rtexprvalue>
-        <description>
-          the facet name to copy
-        </description>
-      </attribute>
-    </tag>        
-
-</taglib>
+<?xml version = "1.0" ?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+	   
+-->
+<taglib
+  xmlns="http://java.sun.com/xml/ns/javaee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+  version="2.1">
+
+  <display-name>Apache Trinidad Core</display-name>    
+  <tlib-version>1.2.2</tlib-version>
+  <short-name>tr</short-name>
+  <uri>http://myfaces.apache.org/trinidad</uri>
+  <listener>
+    <listener-class>org.apache.myfaces.trinidadinternal.webapp.TrinidadListenerImpl</listener-class>
+  </listener>
+
+   <tag>
+      <description>
+The forEach tag is a replacement for the JSTL &amp;lt;c:forEach&amp;gt; tag. 
+As of JSF 1.2/JSP 2.1/JSTL 1.2, the regular &amp;lt;c:forEach&amp;gt; tag
+does work with JSF components.  However, it does not support varStatus
+with JSF!  (Unlike c:forEach, tr:forEach doesn't currently support anything
+for "items" other than arrays and lists.)
+      </description>
+      <name>forEach</name>
+      <tag-class>org.apache.myfaces.trinidadinternal.taglib.ForEachTag</tag-class>
+      <body-content>JSP</body-content>
+
+      <attribute>
+        <description>
+          the items over which iteration takes place 
+        </description>
+        <name>items</name>
+        <deferred-value/>
+      </attribute>
+
+      <attribute>
+        <description>
+          the name of the variable to expose
+        </description>
+        <name>var</name>
+        <rtexprvalue>false</rtexprvalue>
+      </attribute>
+
+      <attribute>
+        <description>
+          Name of the exported scoped variable for the
+          status of the iteration.
+        </description>
+        <name>varStatus</name>
+        <rtexprvalue>false</rtexprvalue>
+      </attribute>
+
+      <attribute>
+        <description>
+          the beginning index 
+        </description>
+        <name>begin</name>
+        <deferred-value>
+          <type>java.lang.Integer</type>
+        </deferred-value>
+      </attribute>
+
+      <attribute>
+        <description>
+          the ending index 
+        </description>
+        <name>end</name>
+        <deferred-value>
+          <type>java.lang.Integer</type>
+        </deferred-value>
+      </attribute>
+
+      <attribute>
+        <description>
+          the number of steps per iteration
+        </description>
+        <name>step</name>
+        <deferred-value>
+          <type>java.lang.Integer</type>
+        </deferred-value>
+      </attribute>
+
+   </tag>
+
+   <tag>
+      <description>
+        The setActionListener tag provides a declarative syntax for assigning values before an action fires
+      </description>
+
+      <name>setActionListener</name>
+      <tag-class>org.apache.myfaces.trinidadinternal.taglib.listener.SetActionListenerTag</tag-class>
+      <body-content>empty</body-content>
+      <attribute>
+        <description>
+          the target for the value;  must be an EL expression
+        </description>
+        <name>to</name>
+        <required>true</required>
+        <deferred-value/>
+      </attribute>
+
+      <attribute>
+        <description>
+          the source of the value;  can be an EL expression or a constant value
+        </description>
+        <name>from</name>
+        <required>true</required>
+        <deferred-value/>
+      </attribute>
+   </tag>
+
+   <tag>
+      <name>fileDownloadActionListener</name>
+      <tag-class>org.apache.myfaces.trinidadinternal.taglib.listener.FileDownloadActionListenerTag</tag-class>
+      <body-content>empty</body-content>
+      <description>
+        The fileDownloadActionListener tag provides a declarative syntax for downloading files to a user from a command component.
+      </description>
+
+      <attribute>
+        <description>
+          the content or mime type of the file - e.g., text/html or application/pdf
+        </description>
+        <name>contentType</name>
+        <deferred-value/>
+      </attribute>
+
+      <attribute>
+        <description>
+          the desired or proposed filename.  If set, the user will typically be presented with a "Save File" dialog, though this is ultimately at the descretion of the user agent.
+        </description>
+        <name>filename</name>
+        <deferred-value/>
+      </attribute>
+
+      <attribute>
+        <description>
+          an EL binding to the method that will deliver the file contents.  The method must take two parameters, a FacesContext and an OutputStream.
+        </description>
+        <name>method</name>
+        <required>true</required>
+        <deferred-method>
+          <method-signature>void myMethod(javax.faces.context.FacesContext, java.io.OutputStream)</method-signature>
+        </deferred-method>
+      </attribute>
+   </tag>
+
+   <tag>
+      <description>
+        The returnActionListener tag is a declarative way to allow an action source to return 
+        a value from a dialog or process.
+      </description>
+      <name>returnActionListener</name>
+      <tag-class>org.apache.myfaces.trinidadinternal.taglib.listener.ReturnActionListenerTag</tag-class>
+      <body-content>empty</body-content>
+
+      <attribute>
+        <description>
+          The value to return as the dialog/process result.
+          This can be an EL expression or a constant value.
+        </description>
+        <name>value</name>
+        <deferred-value/>
+      </attribute>
+   </tag>
+
+
+   <tag>
+      <description>
+        The resetActionListener tag provides a declarative syntax for resetting values before an action fires
+      </description>
+      <name>resetActionListener</name>
+      <tag-class>org.apache.myfaces.trinidadinternal.taglib.listener.ResetActionListenerTag</tag-class>
+      <body-content>empty</body-content>
+   </tag>
+ 
+   <tag>
+      <description> 
+
+      The componentRef tag adds declarative components onto the current
+      component tree. The declarative component is usually defined in a jsp
+      file.  It is currently experimental and should not be used by
+      developers.
+
+      </description>
+
+      <name>componentRef</name>
+      <tag-class>org.apache.myfaces.trinidadinternal.taglib.ComponentRefTag</tag-class>
+      <body-content>JSP</body-content>
+      <attribute>
+        <description>
+Identifies which declarative component to use. 
+All the available components must be
+declared in a region-metadata.xml file.
+        </description>
+        <name>componentType</name>
+        <required>true</required>
+        <deferred-value/>
+      </attribute>
+
+      <attribute>
+        <description>
+          This ID must be unique within this page. 
+        </description>
+        <name>id</name>
+        <required>true</required>
+      </attribute>
+
+      <attribute>
+        <description>
+          A value to pass to the component definition.
+        </description>
+        <name>value</name>
+        <required>false</required>
+        <deferred-value/>
+      </attribute>
+
+      <attribute>
+        <description>
+          Whether or not this component is rendered.
+        </description>
+        <name>rendered</name>
+        <required>false</required>
+        <deferred-value/>
+      </attribute>
+
+   </tag>
+
+
+    <tag>
+      <description>
+        The componentDef tag is used to define a component. Its primary purpose
+is defining a "var" property so that the definition can refer to attributes
+on this component's usage.
+      </description>
+      <name>componentDef</name>   
+      <tag-class>org.apache.myfaces.trinidadinternal.taglib.ComponentDefTag</tag-class>
+      <body-content>JSP</body-content>
+      <attribute>
+        <description>
+          the variable name to use when referencing attributes, that may be set
+          on this new component.
+        </description>
+        <name>var</name>
+        <rtexprvalue>false</rtexprvalue>
+      </attribute>
+    </tag>        
+
+
+    <tag>
+      <description>
+        The facetRef tag is used to copy facets from a component
+        and paste them into its
+        definition. This tag may only be used within an &lt;tr:componentDef&gt;
+        tag.
+        Each facet may be used only once within each 
+        &lt;tr:componentDef&gt;. In other words, a single facet cannot be
+        used more than once.
+      </description>
+      <name>facetRef</name>   
+      <tag-class>org.apache.myfaces.trinidadinternal.taglib.FacetRefTag</tag-class>
+      <body-content>JSP</body-content>
+      <attribute>
+        <description>
+          the facet name to copy
+        </description>
+        <name>facetName</name>
+        <rtexprvalue>false</rtexprvalue>
+      </attribute>
+    </tag>        
+
+</taglib>

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/conf/META-INF/trh-base.tld
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/conf/META-INF/trh-base.tld?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/conf/META-INF/trh-base.tld (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/conf/META-INF/trh-base.tld Mon Nov 12 13:03:17 2007
@@ -1,30 +1,30 @@
-<?xml version = "1.0" ?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
-	   
--->
-<!DOCTYPE taglib 
-   PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
-          "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">
-<taglib>
-  <tlib-version>11-m3</tlib-version>
-  <jsp-version>1.2</jsp-version>
-  <short-name>trh</short-name>
-  <uri>http://myfaces.apache.org/trinidad/html</uri>
-  <display-name>Apache Trinidad HTML</display-name>
-</taglib>
+<?xml version = "1.0" ?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+	   
+-->
+<taglib
+  xmlns="http://java.sun.com/xml/ns/javaee"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-jsptaglibrary_2_1.xsd"
+  version="2.1">
+  <display-name>Apache Trinidad HTML</display-name>
+  <tlib-version>11-m3</tlib-version>
+  <short-name>trh</short-name>
+  <uri>http://myfaces.apache.org/trinidad/html</uri>
+</taglib>

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/application/ViewHandlerImpl.java Mon Nov 12 13:03:17 2007
@@ -34,6 +34,7 @@
 
 import javax.faces.FacesException;
 import javax.faces.application.ViewHandler;
+import javax.faces.application.ViewHandlerWrapper;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
@@ -58,10 +59,9 @@
  * @todo Rename something less generic
  * @todo Support extension mapping (*.faces)
  * @todo The modification detection only works for a single user.  That's
- *   OK for now, because it's intended for use while developing, not while
- *   deployed - yet it's on all the time.  Hrm.
+ *   OK for now, because it's intended for use while developing
  */
-public class ViewHandlerImpl extends ViewHandler
+public class ViewHandlerImpl extends ViewHandlerWrapper
 {
   static public final String ALTERNATE_VIEW_HANDLER =
     "org.apache.myfaces.trinidad.ALTERNATE_VIEW_HANDLER";
@@ -74,16 +74,9 @@
     _loadInternalViews();
   }
 
-  @Override
-  public Locale calculateLocale(FacesContext context)
-  {
-    return _delegate.calculateLocale(context);
-  }
-
-  @Override
-  public String calculateRenderKitId(FacesContext context)
+  protected ViewHandler getWrapped()
   {
-    return _delegate.calculateRenderKitId(context);
+    return _delegate;
   }
 
   @Override
@@ -122,13 +115,13 @@
       }
     }
 
-    return _delegate.createView(context, viewId);
+    return super.createView(context, viewId);
   }
 
   @Override
   public String getActionURL(FacesContext context, String viewId)
   {
-    String actionURL = _delegate.getActionURL(context, viewId);
+    String actionURL = super.getActionURL(context, viewId);
     RequestContext afContext = RequestContext.getCurrentInstance();
     if (afContext != null)
     {
@@ -145,7 +138,7 @@
     FacesContext context,
     String       path)
   {
-    return _delegate.getResourceURL(context, path);
+    return super.getResourceURL(context, path);
   }
 
 
@@ -180,7 +173,7 @@
         }
         else
         {
-          _delegate.renderView(context, viewToRender);
+          super.renderView(context, viewToRender);
         }
 
         if (service != null)
@@ -264,7 +257,7 @@
       return null;
     }
 
-    UIViewRoot result = _delegate.restoreView(context, viewId);
+    UIViewRoot result = super.restoreView(context, viewId);
     // If we've successfully restored a view, then assume that
     // this is a postback request.
     if (result != null)
@@ -293,7 +286,7 @@
         service.isStateless(context))
       return;
 
-    _delegate.writeState(context);
+    super.writeState(context);
   }
 
   synchronized private void _initIfNeeded(FacesContext context)

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/AccessKeyBinding.java Mon Nov 12 13:03:17 2007
@@ -18,8 +18,11 @@
  */
 package org.apache.myfaces.trinidadinternal.binding;
 
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
+import java.io.Serializable;
+
+import javax.el.ValueExpression;
+import javax.el.ELContext;
+import javax.el.PropertyNotWritableException;
 
 import org.apache.myfaces.trinidadinternal.util.nls.StringUtils;
 
@@ -29,25 +32,25 @@
  * access key.
  *
  */
-public class AccessKeyBinding extends ValueBindingAdapter
+public class AccessKeyBinding extends ValueExpression implements Serializable
 {
   /**
    * Constructor purely for serialization.
    */
   public AccessKeyBinding()
   {
-    super(null);
   }
 
-  public AccessKeyBinding(ValueBinding base)
+  public AccessKeyBinding(ValueExpression expr)
   {
-    super(base);
+    _base = expr;
   }
 
+
   @Override
-  public Object getValue(FacesContext context)
+  public Object getValue(ELContext context)
   {
-    Object o = super.getValue(context);
+    Object o = _base.getValue(context);
     if (o == null)
       return null;
 
@@ -60,8 +63,51 @@
   }
 
   @Override
-  public Class<?> getType(FacesContext context)
+  public void setValue(ELContext context, Object value)
+  {
+    throw new PropertyNotWritableException();
+  }
+
+  @Override
+  public Class<?> getType(ELContext context)
+  {
+    return Character.class;
+  }
+
+  @Override
+  public Class<?> getExpectedType()
   {
     return Character.class;
   }
+
+  @Override
+  public boolean isReadOnly(ELContext context)
+  {
+    return true;
+  }
+
+
+  @Override
+  public boolean isLiteralText()
+  {
+    return false;
+  }
+
+  @Override
+  public String getExpressionString()
+  {
+    return null;
+  }
+
+  public int hashCode()
+  {
+    return 0;
+  }
+
+  public boolean equals(Object o)
+  {
+    return (o == this);
+  }
+
+  private ValueExpression _base;
 }

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/binding/StripAccessKeyBinding.java Mon Nov 12 13:03:17 2007
@@ -18,8 +18,11 @@
  */
 package org.apache.myfaces.trinidadinternal.binding;
 
-import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
+import java.io.Serializable;
+
+import javax.el.ValueExpression;
+import javax.el.ELContext;
+import javax.el.PropertyNotWritableException;
 
 import org.apache.myfaces.trinidadinternal.util.nls.StringUtils;
 
@@ -29,25 +32,18 @@
  * the mnemonic.
  *
  */
-public class StripAccessKeyBinding extends ValueBindingAdapter
+public class StripAccessKeyBinding extends ValueExpression implements Serializable
 {
-  /**
-   * Constructor purely for serialization.
-   */
-  public StripAccessKeyBinding()
-  {
-    super(null);
-  }
 
-  public StripAccessKeyBinding(ValueBinding base)
+  public StripAccessKeyBinding(ValueExpression base)
   {
-    super(base);
+    _base = base;
   }
 
   @Override
-  public Object getValue(FacesContext context)
+  public Object getValue(ELContext context)
   {
-    Object o = super.getValue(context);
+    Object o = _base.getValue(context);
     if (o == null)
       return null;
 
@@ -60,8 +56,50 @@
   }
 
   @Override
-  public Class<?> getType(FacesContext context)
+  public void setValue(ELContext context, Object value)
+  {
+    throw new PropertyNotWritableException();
+  }
+
+  @Override
+  public Class<?> getType(ELContext context)
+  {
+    return Character.class;
+  }
+
+  @Override
+  public Class<?> getExpectedType()
+  {
+    return Character.class;
+  }
+
+  @Override
+  public boolean isReadOnly(ELContext context)
   {
-    return String.class;
+    return true;
   }
+
+  @Override
+  public boolean isLiteralText()
+  {
+    return false;
+  }
+
+  @Override
+  public String getExpressionString()
+  {
+    return null;
+  }
+
+  public int hashCode()
+  {
+    return 0;
+  }
+
+  public boolean equals(Object o)
+  {
+    return (o == this);
+  }
+
+  private ValueExpression _base;
 }

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/ConfigParser.java Mon Nov 12 13:03:17 2007
@@ -24,6 +24,8 @@
 import java.util.Map;
 import java.util.TimeZone;
 
+import javax.el.ValueExpression;
+
 import javax.faces.context.ExternalContext;
 import javax.faces.el.ValueBinding;
 import javax.xml.parsers.ParserConfigurationException;
@@ -195,9 +197,10 @@
             }
             else
             {
-              ValueBinding binding =
-                LazyValueBinding.createValueBinding(currentText);
-              _bean.setValueBinding(key, binding);
+              ValueExpression expression =
+                LazyValueExpression.createValueExpression(_currentText, 
+                                                          key.getType());
+              _bean.setValueExpression(key, expression);
             }
           }
           else

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/GlobalConfiguratorImpl.java Mon Nov 12 13:03:17 2007
@@ -25,13 +25,26 @@
 
 import javax.faces.context.ExternalContext;
 
+import javax.servlet.ServletRequest;
+
+import javax.servlet.ServletRequestWrapper;
+
+import javax.servlet.http.HttpServletRequest;
+
 import org.apache.myfaces.trinidad.config.Configurator;
+import org.apache.myfaces.trinidad.context.ExternalContextDecorator;
 import org.apache.myfaces.trinidad.context.RequestContext;
 import org.apache.myfaces.trinidad.context.RequestContextFactory;
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.skin.SkinFactory;
 import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
 import org.apache.myfaces.trinidadinternal.context.RequestContextFactoryImpl;
+import org.apache.myfaces.trinidadinternal.context.external.ServletCookieMap;
+import org.apache.myfaces.trinidadinternal.context.external.ServletRequestHeaderMap;
+import org.apache.myfaces.trinidadinternal.context.external.ServletRequestHeaderValuesMap;
+import org.apache.myfaces.trinidadinternal.context.external.ServletRequestMap;
+import org.apache.myfaces.trinidadinternal.context.external.ServletRequestParameterMap;
+import org.apache.myfaces.trinidadinternal.context.external.ServletRequestParameterValuesMap;
 import org.apache.myfaces.trinidadinternal.skin.SkinFactoryImpl;
 import org.apache.myfaces.trinidadinternal.skin.SkinUtils;
 import org.apache.myfaces.trinidad.util.ExternalContextUtils;
@@ -264,7 +277,7 @@
         {
           _endConfiguratorServiceRequest(externalContext);
         }
-        
+
         _releaseRequestContext(externalContext);
       }
       RequestType.clearType(externalContext);
@@ -293,6 +306,17 @@
 
     if (!_isDisabled(externalContext))
     {
+      if(!ExternalContextUtils.isPortlet(externalContext) && _isSetRequestBugPresent(externalContext))
+      {
+        //This handles bug 493 against the JSF-RI 1.2_03 and earlier.  If the bug
+        //is present in the current system, add a wrapper to fix it
+
+        //TODO sobryan this is somewhat inefficient so should be removed when we
+        //are no longer dependant on JSF1.2_03 or earlier.  Still, we only wrap
+        //when we have to so it should be no biggy under normal circumstances.
+        externalContext = new ClearRequestExternalContext(externalContext);
+      }
+
       // Wrap ExternalContexts
       for (final Configurator config : _services)
       {
@@ -401,7 +425,7 @@
 
     assert RequestContext.getCurrentInstance() == context;
   }
-  
+
   private void _releaseRequestContext(final ExternalContext ec)
   {
     //If it's not a portal action, we should remove the cached request because
@@ -410,13 +434,13 @@
     {
       ec.getRequestMap().remove(_REQUEST_CONTEXT);
     }
-    
+
     final RequestContext context = RequestContext.getCurrentInstance();
     if (context != null)
     {
       context.release();
       assert RequestContext.getCurrentInstance() == null;
-    }    
+    }
   }
 
   private void _endConfiguratorServiceRequest(final ExternalContext ec)
@@ -446,15 +470,174 @@
     }
   }
 
-  private boolean            _initialized;
-  private List<Configurator> _services;
-  static private final Map<ClassLoader, GlobalConfiguratorImpl> _CONFIGURATORS = new HashMap<ClassLoader, GlobalConfiguratorImpl>();
-  static private final String _IN_REQUEST    = GlobalConfiguratorImpl.class
-                                                         .getName()
-                                                         + ".IN_REQUEST";
-  static private final String _REQUEST_CONTEXT = GlobalConfiguratorImpl.class.getName()
-                                                         +".REQUEST_CONTEXT";
-  static private final TrinidadLogger _LOG  = TrinidadLogger.createTrinidadLogger(GlobalConfiguratorImpl.class);
+  static private boolean _isSetRequestBugPresent(ExternalContext ec)
+  {
+    // This first check is here in order to skip synchronization until
+    // absolutely necessary.
+    if(!_sSetRequestBugTested)
+    {
+      synchronized(GlobalConfiguratorImpl.class)
+      {
+        //This second check is here in case a couple of things enter before the
+        //boolean is set.  This is only an exception case and will make it so
+        //the initialization code runs only once.
+        if(!_sSetRequestBugTested)
+        {
+          ServletRequest orig = (ServletRequest)ec.getRequest();
+          // Call getInitParameterMap() up front
+          ec.getInitParameterMap();
+
+          ec.setRequest(new TestRequest(orig));
+
+          _sHasSetRequestBug = !TestRequest.isTestParamPresent(ec);
+          _sSetRequestBugTested = true;
+
+          ec.setRequest(orig);
+        }
+      }
+    }
+
+    return _sHasSetRequestBug;
+  }
+
+  // This handles an issue with the ExternalContext object prior to
+  // JSF1.2_04.
+  static private class ClearRequestExternalContext extends ExternalContextDecorator
+  {
+    private ExternalContext _ec;
+    private Map<String, Object>         _requestCookieMap;
+    private Map<String, String>         _requestHeaderMap;
+    private Map<String, String[]>       _requestHeaderValuesMap;
+    private Map<String, Object>         _requestMap;
+    private Map<String, String>         _requestParameterMap;
+    private Map<String, String[]>       _requestParameterValuesMap;
+
+    public ClearRequestExternalContext(ExternalContext ec)
+    {
+      _ec = ec;
+    }
+
+    @Override
+    protected ExternalContext getExternalContext()
+    {
+      return _ec;
+    }
+
+    @Override
+    public void setRequest(Object request)
+    {
+      super.setRequest(request);
+
+      // And clear out any of the cached maps, since we should
+      // go back and look in the map
+      _requestCookieMap = null;
+      _requestHeaderMap = null;
+      _requestHeaderValuesMap = null;
+      _requestMap = null;
+      _requestParameterMap = null;
+      _requestParameterValuesMap = null;
+    }
+
+    @Override
+    public Map<String, Object> getRequestCookieMap()
+    {
+      _checkRequest();
+      if (_requestCookieMap == null)
+      {
+
+        _requestCookieMap = new ServletCookieMap(_getHttpServletRequest());
+      }
+      return _requestCookieMap;
+    }
+
+    @Override
+    public Map<String, String> getRequestHeaderMap()
+    {
+      if (_requestHeaderMap == null)
+      {
+        _requestHeaderMap = new ServletRequestHeaderMap(_getHttpServletRequest());
+      }
+      return _requestHeaderMap;
+    }
+
+    @Override
+    public Map<String, String[]> getRequestHeaderValuesMap()
+    {
+      if (_requestHeaderValuesMap == null)
+      {
+        _requestHeaderValuesMap = new ServletRequestHeaderValuesMap(_getHttpServletRequest());
+      }
+      return _requestHeaderValuesMap;
+    }
+
+    @Override
+    public Map<String, Object> getRequestMap()
+    {
+      _checkRequest();
+      if (_requestMap == null)
+      {
+        _requestMap = new ServletRequestMap((ServletRequest)getRequest());
+      }
+      return _requestMap;
+    }
+
+    @Override
+    public Map<String, String> getRequestParameterMap()
+    {
+      _checkRequest();
+      if (_requestParameterMap == null)
+      {
+        _requestParameterMap = new ServletRequestParameterMap((ServletRequest)getRequest());
+      }
+      return _requestParameterMap;
+    }
+
+    @Override
+    public Map<String, String[]> getRequestParameterValuesMap()
+    {
+      _checkRequest();
+      if (_requestParameterValuesMap == null)
+      {
+        _requestParameterValuesMap = new ServletRequestParameterValuesMap((ServletRequest)getRequest());
+      }
+      return _requestParameterValuesMap;
+    }
+
+    private void _checkRequest()
+    {
+      if(super.getRequest() == null)
+      {
+        throw new UnsupportedOperationException("Request is null on this context.");
+      }
+    }
+
+    private HttpServletRequest _getHttpServletRequest()
+    {
+      _checkRequest();
+      if ( !(getRequest() instanceof HttpServletRequest))
+      {
+         throw new IllegalArgumentException("Only HttpServletRequest supported");
+      }
+
+      return (HttpServletRequest)getRequest();
+    }
+  }
+
+
+  private static volatile boolean _sSetRequestBugTested = false;
+  private static boolean _sHasSetRequestBug = false;
+
+  private boolean             _initialized;
+  private List<Configurator>  _services;
+  static private final Map<ClassLoader, GlobalConfiguratorImpl> _CONFIGURATORS =
+     new HashMap<ClassLoader, GlobalConfiguratorImpl>();
+  static private final String _IN_REQUEST    =
+     GlobalConfiguratorImpl.class.getName()
+     + ".IN_REQUEST";
+  static private final String _REQUEST_CONTEXT =
+     GlobalConfiguratorImpl.class.getName()
+     + ".REQUEST_CONTEXT";
+
 
   private enum RequestType
   {
@@ -505,4 +688,35 @@
     static private final String _REQUEST_TYPE = GlobalConfiguratorImpl.class.getName()
                                                   + ".REQUEST_TYPE";
   }
+
+  static private class TestRequest extends ServletRequestWrapper
+  {
+    public TestRequest(ServletRequest request)
+    {
+      super(request);
+    }
+
+    @Override
+    public String getParameter(String string)
+    {
+      if(_TEST_PARAM.equals(string))
+      {
+        return "passed";
+      }
+
+      return super.getParameter(string);
+    }
+
+    static public final boolean isTestParamPresent(ExternalContext ec)
+    {
+      return ec.getRequestParameterMap().get(_TEST_PARAM) != null;
+    }
+
+    static private String _TEST_PARAM = TestRequest.class.getName()+
+      ".TEST_PARAM";
+  }
+
+
+  static private final TrinidadLogger _LOG =
+    TrinidadLogger.createTrinidadLogger(GlobalConfiguratorImpl.class);
 }

Copied: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.java (from r593616, myfaces/trinidad/branches/1.2.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.java)
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.java?p2=myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.java&p1=myfaces/trinidad/branches/1.2.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.java&r1=593616&r2=594297&rev=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.3-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/LazyValueExpression.java Mon Nov 12 13:03:17 2007
@@ -39,92 +39,92 @@
   * expression won't get detected until use.
   *
   */
-class LazyValueExpression extends ValueExpression
+public class LazyValueExpression extends ValueExpression
 {
 
   /**
    * Create a ValueExpression
    */
   static public ValueExpression createValueExpression(
-    String expression, 
+    String expression,
     Class<?> expectedType)
   {
     // Try to create the ValueExpression from the Application object
     // This will return null if the ApplicationFactory or Application
     // objects are null.
-    ValueExpression valueExpression= 
+    ValueExpression valueExpression=
       _createValueExpressionFromApplication(expression, expectedType);
-    
+
     if (valueExpression != null)
       return valueExpression;
-    
-    // We couldn't create a regular ValueExpression, so create a 
-    // LazyValueExpression. This will try to create a regular 
+
+    // We couldn't create a regular ValueExpression, so create a
+    // LazyValueExpression. This will try to create a regular
     // ValueExpression later when a 'get' method is called.
     return new LazyValueExpression(expression, expectedType);
   }
-  
+
   @Override
   public Object getValue(ELContext context)
   {
     return _getValueExpression().getValue(context);
-  }  
-  
+  }
+
   @Override
-  public void setValue(ELContext context, java.lang.Object value) 
-  {   
+  public void setValue(ELContext context, java.lang.Object value)
+  {
     _getValueExpression().setValue(context, value);
   }
-  
+
   @Override
-  public boolean isReadOnly(ELContext context) 
-  { 
+  public boolean isReadOnly(ELContext context)
+  {
     return _getValueExpression().isReadOnly(context);
   }
 
   @Override
-  public java.lang.Class<?> getType(ELContext context) 
-  { 
+  public java.lang.Class<?> getType(ELContext context)
+  {
     return _getValueExpression().getType(context);
   }
 
   @Override
-  public java.lang.Class<?> getExpectedType() 
-  { 
+  public java.lang.Class<?> getExpectedType()
+  {
     return _expectedType;
   }
-  
+
   @Override
   public String getExpressionString()
   {
     return _expression;
-  }  
-  
+  }
+
   @Override
   public boolean isLiteralText()
   {
     return _getValueExpression().isLiteralText();
   }
-  
+
   @Override
   public boolean equals(Object o)
   {
     return _getValueExpression().equals(o);
   }
-  
+
   @Override
   public int hashCode ()
   {
     return _getValueExpression().hashCode();
-  }  
+  }
 
   private LazyValueExpression(
-    String expression, 
+    String expression,
     Class<?> expectedType)
   {
     _expression = expression;
     _expectedType = expectedType;
-    
+
   }
 
   // Get the ELContext off of the FacesContext, if the FacesContext is not
@@ -132,7 +132,7 @@
   private static ELContext _getELContext(Application application)
   {
     FacesContext fContext = FacesContext.getCurrentInstance();
-    
+
     if (fContext != null)
     {
       return fContext.getELContext();
@@ -152,18 +152,18 @@
 
     if (_valueExpression == null)
     {
-      _valueExpression = 
+      _valueExpression =
         _createValueExpressionFromApplication(_expression, _expectedType);
     }
 
     return _valueExpression;
   }
-  
+
   // Create a ValueExpression object from the Application object, if the
   // ApplicationFactory and Application objects exist, and return it.
   // Otherwise, return null.
   private static ValueExpression _createValueExpressionFromApplication(
-    String expression, 
+    String expression,
     Class<?> expectedType)
   {
     ApplicationFactory factory = (ApplicationFactory)
@@ -174,17 +174,17 @@
       if (application != null)
       {
         ELContext elContext = _getELContext(application);
-  
-        return  
+
+        return
           application.getExpressionFactory().
             createValueExpression(elContext, expression, expectedType);
-      
+
       }
     }
 
     return null;
   }
-  
+
   // This is used to mock up a dummy ELContext to pass into createValueExpression
   // if the FacesContext is null and we can't get FacesContext.getELContext.
   private static class MockELContext extends ELContext
@@ -195,17 +195,17 @@
     }
 
     @Override
-    public ELResolver getELResolver() 
+    public ELResolver getELResolver()
     {
       return _resolver;
     }
-    
+
     @Override
     public FunctionMapper getFunctionMapper()
     {
       return null;
     }
-    
+
     @Override
     public VariableMapper getVariableMapper()
     {
@@ -216,7 +216,7 @@
   }
 
 
-  private ValueExpression _valueExpression;             
+  private ValueExpression _valueExpression;
   private final String    _expression;
   private final Class<?>  _expectedType;
 

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/dispatch/DispatchResponseConfiguratorImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/dispatch/DispatchResponseConfiguratorImpl.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/dispatch/DispatchResponseConfiguratorImpl.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/dispatch/DispatchResponseConfiguratorImpl.java Mon Nov 12 13:03:17 2007
@@ -29,7 +29,6 @@
 import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
-import javax.servlet.ServletResponse;
 
 import org.apache.myfaces.trinidad.config.Configurator;
 import org.apache.myfaces.trinidad.context.ExternalContextDecorator;
@@ -48,28 +47,24 @@
   @Override
   public ExternalContext getExternalContext(ExternalContext externalContext)
   {
-    // TODO sobryan (dependency = JSF 1.2)
-    // For JSF 1.2, we can probably simply wrap the request objects and set them on
-    // the existing ExternalContext.
     if(!isApplied(externalContext))
     {
       if(ExternalContextUtils.isPortlet(externalContext))
       {
         if(!ExternalContextUtils.isAction(externalContext))
         {
-          apply(externalContext);
-          return new PortletExternalContext(externalContext);
+          externalContext.setResponse(new DispatchRenderResponse(externalContext));
         }
       }
       else
       {
-        apply(externalContext);
-        return new ServletExternalContext(externalContext);
+        externalContext.setResponse(new DispatchServletResponse(externalContext));
       }
-    }
 
+      apply(externalContext);
+    }
 
-    //return the origional
+    //return the original
     return externalContext;
   }
 
@@ -79,104 +74,6 @@
   {
     Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
     return (String) requestMap.get(__CONTENT_TYPE_KEY);
-  }
-
-  static private class ServletExternalContext extends ExternalContextDecorator
-  {
-    public ServletExternalContext(ExternalContext ec)
-    {
-      _ec = ec;
-    }
-
-    @Override
-    public Object getResponse()
-    {
-      if(_response == null)
-      {
-        _response = new DispatchServletResponse(_ec);
-      }
-
-      return _response;
-    }
-
-    @Override
-    protected ExternalContext getExternalContext()
-    {
-      return _ec;
-    }
-
-    private ServletResponse  _response;
-    private ExternalContext _ec;
-  }
-
-  static private class PortletExternalContext extends ExternalContextDecorator
-  {
-    public PortletExternalContext(ExternalContext ec)
-    {
-      _ec = ec;
-    }
-
-    @Override
-    public Object getContext()
-    {
-      return _getPortletContext();
-    }
-
-    @Override
-    public Object getResponse()
-    {
-      return _getRenderResponse();
-    }
-
-    @Override
-    public void dispatch(String path) throws IOException
-    {
-      final PortletRequestDispatcher requestDispatcher =
-        ((PortletContext)getContext()).getRequestDispatcher(path);
-      try
-      {
-        requestDispatcher.include((RenderRequest)getRequest(), (RenderResponse)getResponse());
-      }
-      catch (final PortletException e)
-      {
-        if (e.getMessage() != null)
-        {
-          throw new FacesException(e.getMessage(), e);
-        }
-        else
-        {
-          throw new FacesException(e);
-        }
-      }
-    }
-
-    @Override
-    protected ExternalContext getExternalContext()
-    {
-      return _ec;
-    }
-
-    private PortletContext _getPortletContext()
-    {
-      if(_context == null)
-      {
-        _context = new PortletContextWrapper((PortletContext)_ec.getContext());
-      }
-      return _context;
-    }
-
-    private RenderResponse _getRenderResponse()
-    {
-      if(_response == null)
-      {
-        _response = new DispatchRenderResponse(_ec);
-      }
-      return _response;
-    }
-
-    private ExternalContext _ec;
-    private RenderResponse _response;
-    private PortletContext _context;
   }
 
   /**

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/FileUploadConfiguratorImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/FileUploadConfiguratorImpl.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/FileUploadConfiguratorImpl.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/upload/FileUploadConfiguratorImpl.java Mon Nov 12 13:03:17 2007
@@ -25,6 +25,10 @@
 import java.util.Map;
 
 import javax.faces.context.ExternalContext;
+
+import javax.portlet.ActionRequest;
+
+import javax.servlet.ServletRequest;
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.myfaces.trinidad.config.Configurator;
@@ -208,8 +212,10 @@
     if(!isApplied(externalContext))
     {
       if(!ExternalContextUtils.isPortlet(externalContext))
-      {
-        return new ServletUploadedExternalContext(externalContext, addedParams);
+      {  
+        externalContext.setRequest(new UploadRequestWrapper(
+            (HttpServletRequest)externalContext.getRequest(),
+            addedParams));        
       }
       else if(ExternalContextUtils.isAction(externalContext))
       {
@@ -219,8 +225,10 @@
          * RenderParameters.  This is a cool thing because subsequent
          * render requests will retain these parameters for us.
          */
-        return new PortletUploadedExternalContext(externalContext, addedParams);
+        externalContext.setRequest(new ActionUploadRequestWrapper(externalContext,
+           addedParams));
       }
+      apply(externalContext);        
     }
 
     //If we don't have any wrapped params or we have a render portal request,

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/xmlHttp/XmlHttpConfigurator.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/xmlHttp/XmlHttpConfigurator.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/xmlHttp/XmlHttpConfigurator.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/config/xmlHttp/XmlHttpConfigurator.java Mon Nov 12 13:03:17 2007
@@ -50,11 +50,6 @@
   {
   }
 
-  public static ServletResponse getWrappedServletResponse(ServletResponse response)
-  {
-    return new XmlHttpServletResponse(response);
-  }
-
   public static ServletRequest getAjaxServletRequest(ServletRequest request)
   {
     return new XmlHttpServletRequest(request);
@@ -63,6 +58,12 @@
   public static void beginRequest(ExternalContext externalContext)
   {
     StateManagerImpl.reuseRequestTokenForResponse(externalContext);
+    Object response = externalContext.getResponse();
+    if (response instanceof ServletResponse)
+    {
+      externalContext.setResponse(
+         new XmlHttpServletResponse((ServletResponse) response));
+    }
   }
 
   /**

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/DialogServiceImpl.java Mon Nov 12 13:03:17 2007
@@ -24,10 +24,11 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.el.ValueExpression;
+
 import javax.faces.component.UIComponent;
 import javax.faces.component.UIViewRoot;
 import javax.faces.context.FacesContext;
-import javax.faces.el.ValueBinding;
 import javax.faces.render.RenderKit;
 
 import org.apache.myfaces.trinidad.context.RequestContext;
@@ -213,8 +214,9 @@
     FacesContext context = _getFacesContext();
     if (TrinidadFilterImpl.isExecutingDialogReturn(context))
     {
-      Map<String, Object> parameterMap = context.getExternalContext().getRequestParameterMap();
-      Object returnParam = parameterMap.get(_RETURN_PARAM);
+      Map<String, String> parameterMap =
+        context.getExternalContext().getRequestParameterMap();
+      String returnParam = parameterMap.get(_RETURN_PARAM);
       if (returnParam == null)
         return null;
 
@@ -464,9 +466,9 @@
   @SuppressWarnings("unchecked")
   private void _executeBindings(FacesContext context, UIComponent component)
   {
-    ValueBinding binding = component.getValueBinding("binding");
-    if (binding != null)
-      binding.setValue(context, component);
+    ValueExpression expression = component.getValueExpression("binding");
+    if (expression != null)
+      expression.setValue(context.getELContext(), component);
 
     Iterator<UIComponent> kids = component.getFacetsAndChildren();
     while (kids.hasNext())

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/FacesContextFactoryImpl.java Mon Nov 12 13:03:17 2007
@@ -22,6 +22,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import javax.el.ELContext;
+
 import javax.faces.application.Application;
 import javax.faces.application.FacesMessage;
 import javax.faces.component.UIViewRoot;
@@ -231,6 +233,11 @@
       _base.release();
     }
     
+    public ELContext getELContext()
+    {
+      return _base.getELContext();
+    }
+
     private final FacesContext    _base;
     private final ExternalContext _external;
     // An Object, not a String, so that FindBugs won't complain

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/RequestContextImpl.java Mon Nov 12 13:03:17 2007
@@ -524,6 +524,17 @@
     }
   }
 
+  /**
+   * Returns the set of partial targets related to a given UIComponent.
+   */
+  @Override
+  public Set<UIComponent> getPartialTargets(UIComponent source)
+  {
+    HashSet<UIComponent> set = new HashSet<UIComponent>();
+    _addPartialTargets(set, source);
+    return set;    
+  }
+  
   @Override
   public void addPartialTriggerListeners
     (UIComponent listener,
@@ -805,7 +816,32 @@
 
     return _partialListeners;
   }
-  
+
+  //
+  // Recursively builds up the set of partial targets of
+  // a given component
+  //
+  private void _addPartialTargets(
+    Set<UIComponent> sofar, UIComponent from)
+  {
+    Map<UIComponent, Set<UIComponent>> pl = _getPartialListeners();
+    Set<UIComponent> listeners = pl.get(from);
+    if (listeners == null)
+      return;
+    
+    for (UIComponent target : listeners)
+    {
+      // If we haven't encountered this target yet, add
+      // it, and continue recursively.
+      if (!sofar.contains(target))
+      {
+        sofar.add(target);
+        _addPartialTargets(sofar, target);
+      }
+    }
+  }
+
+
   private RequestContextBean _bean;
   private HelpProvider        _provider;
   private Map<UIComponent, Set<UIComponent>> _partialListeners;

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/TrinidadPhaseListener.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/TrinidadPhaseListener.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/TrinidadPhaseListener.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/TrinidadPhaseListener.java Mon Nov 12 13:03:17 2007
@@ -18,11 +18,15 @@
  */
 package org.apache.myfaces.trinidadinternal.context;
 
+import javax.faces.context.ExternalContext;
 import javax.faces.context.FacesContext;
 import javax.faces.event.PhaseEvent;
 import javax.faces.event.PhaseId;
 import javax.faces.event.PhaseListener;
 
+import org.apache.myfaces.trinidadinternal.config.xmlHttp.XmlHttpConfigurator;
+import org.apache.myfaces.trinidadinternal.renderkit.core.CoreRenderKit;
+
 /**
  * Performs some trinidad logic and provides some hooks.
  *
@@ -76,9 +80,21 @@
     if (event.getPhaseId() == PhaseId.RESTORE_VIEW)
     {
       FacesContext context = event.getFacesContext();
+      ExternalContext ec = context.getExternalContext();
       // Assume it's not a postback request
-      context.getExternalContext().getRequestMap().put(_POSTBACK_KEY,
-                                                       Boolean.FALSE);      
+      ec.getRequestMap().put(_POSTBACK_KEY, Boolean.FALSE);
+
+      // And initialize XmlHttp.  We wait until beforePhase()
+      // of RESTORE_VIEW, instead of doing this in the filter,
+      // so that we don't get a request parameter before ViewHandler.initView()
+      // has been called:  doing that leads to big problems.  Note
+      // that with the 1.2_03 RI, this will still be too early,
+      // as it called initView() after beforePhase()
+      if (CoreRenderKit.isPartialRequest(ec))
+      {
+        XmlHttpConfigurator.beginRequest(ec);
+      }
+      
     }
     // If we've reached "apply request values", this is definitely a
     // postback (the ViewHandler should have reached the same conclusion too,

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletCookieMap.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletCookieMap.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletCookieMap.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletCookieMap.java Mon Nov 12 13:03:17 2007
@@ -28,9 +28,9 @@
  *
  * @version $Revision: 278654 $ $Date: 2005-09-04 18:32:35 -0600 (Sun, 04 Sep 2005) $
  */
-class ServletCookieMap extends AbstractAttributeMap<String, Object>
+public class ServletCookieMap extends AbstractAttributeMap<String, Object>
 {
-  ServletCookieMap(final HttpServletRequest httpServletRequest)
+  public ServletCookieMap(final HttpServletRequest httpServletRequest)
   {
     _httpServletRequest = httpServletRequest;
   }

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletExternalContext.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletExternalContext.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletExternalContext.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletExternalContext.java Mon Nov 12 13:03:17 2007
@@ -20,7 +20,8 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import java.lang.reflect.Method;
+import java.io.UnsupportedEncodingException;
+
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.security.Principal;
@@ -73,52 +74,8 @@
     }
 
     if (_httpServletRequest != null)
-    {
-      // HACK: MultipartWrapper scrambles the servletPath for some reason in Tomcat 4.1.29 embedded
-      // in JBoss 3.2.3!?
-      // (this was reported by frederic.auge [frederic.auge@laposte.net])
-      _requestServletPath = _httpServletRequest.getServletPath();
-      _requestPathInfo = _httpServletRequest.getPathInfo();
-
-      // try to set character encoding as described in section 2.5.2.2 of JSF 1.1 spec
-      // we have to use reflection as method setCharacterEncoding is not supported Servlet API <=
-      // 2.3
-      try
-      {
-        if (_setCharacterEncodingMethod != null &&
-            !Boolean.TRUE.equals(_httpServletRequest.getAttribute(_CHAR_ENCODING_CALLED)))
-        {
-          // Only invoke this once, no matter how many times we create
-          // the ServletExternalContext
-          _httpServletRequest.setAttribute(_CHAR_ENCODING_CALLED, Boolean.TRUE);
-          final String contentType = _httpServletRequest.getHeader("Content-Type");
-
-          String characterEncoding = _lookupCharacterEncoding(contentType);
-
-          if (characterEncoding == null)
-          {
-            final HttpSession session = _httpServletRequest.getSession(false);
-
-            if (session != null)
-            {
-              characterEncoding = (String) session.getAttribute(ViewHandler.CHARACTER_ENCODING_KEY);
-            }
-
-            if (characterEncoding != null)
-            {
-              _setCharacterEncodingMethod
-                  .invoke(servletRequest, new Object[] { characterEncoding });
-            }
-          }
-        }
-      }
-      catch (final Exception e)
-      {
-        if (_LOG.isWarning())
-        {
-          _LOG.warning("FAIL_SET_CHARACTER_ENCODING", e);
-        }
-      }
+    {      
+      _initHttpServletRequest();
     }
   }
 
@@ -514,6 +471,83 @@
     }
   }
 
+  @Override
+  public String getRequestCharacterEncoding()
+  {
+    _checkRequest();
+    return _servletRequest.getCharacterEncoding();
+  }
+
+  @Override
+  public String getRequestContentType()
+  {
+    _checkRequest();
+    return _servletRequest.getContentType();
+  }
+
+  @Override
+  public String getResponseCharacterEncoding()
+  {
+    _checkResponse();
+    return _servletResponse.getCharacterEncoding();
+  }
+
+  @Override
+  public String getResponseContentType()
+  {
+    _checkResponse();
+    return _servletResponse.getContentType();
+  }
+
+  @Override
+  public void setRequest(Object object)
+  {
+    _servletRequest = (ServletRequest) object;
+    if (object instanceof HttpServletRequest)
+    {
+      _httpServletRequest = (HttpServletRequest) object;
+      _initHttpServletRequest();
+    }
+    else
+    {
+      _httpServletRequest = null;
+    }
+    
+    // And clear out any of the cached maps, since we should 
+    // go back and look in the map
+    _requestCookieMap = null;
+    _requestHeaderMap = null;
+    _requestHeaderValuesMap = null;
+    _requestMap = null;
+    _requestParameterMap = null;
+    _requestParameterValuesMap = null;
+  }
+
+  @Override
+  public void setRequestCharacterEncoding(String string) throws UnsupportedEncodingException
+  {
+    _checkRequest();
+    _servletRequest.setCharacterEncoding(string);
+  }
+
+  @Override
+  public void setResponse(Object object)
+  {
+    _servletResponse = (ServletResponse) object;
+    if (_servletResponse instanceof HttpServletResponse)
+      _httpServletResponse = (HttpServletResponse) object;
+    else
+      _httpServletResponse = null;
+  }
+
+  @Override
+  public void setResponseCharacterEncoding(String string)
+  {
+    _checkResponse();
+    _servletResponse.setCharacterEncoding(string);
+  }
+
+  
   public void release()
   {
     _servletContext = null;
@@ -598,6 +632,41 @@
     return characterEncoding;
   }
 
+  private void _initHttpServletRequest()
+  {
+    // TODO: is this necessary still?
+    // HACK: MultipartWrapper scrambles the servletPath for some reason in Tomcat 4.1.29 embedded
+    // in JBoss 3.2.3!?
+    // (this was reported by frederic.auge [frederic.auge@laposte.net])
+    _requestServletPath = _httpServletRequest.getServletPath();
+    _requestPathInfo = _httpServletRequest.getPathInfo();
+
+    final String contentType = _httpServletRequest.getHeader("Content-Type");
+
+    String characterEncoding = _lookupCharacterEncoding(contentType);
+
+    if (characterEncoding == null)
+    {
+      final HttpSession session = _httpServletRequest.getSession(false);
+      if (session != null)
+      {
+        characterEncoding = (String) session.getAttribute(ViewHandler.CHARACTER_ENCODING_KEY);
+      }
+
+      if (characterEncoding != null)
+      {
+        try
+        {
+          _servletRequest.setCharacterEncoding(characterEncoding);
+        }
+        catch (UnsupportedEncodingException uee)
+        {
+          _LOG.warning(uee);
+        }
+      }
+    }
+  }
+
   private Map<String, Object>         _applicationMap;
   private HttpServletRequest          _httpServletRequest;
   private HttpServletResponse         _httpServletResponse;
@@ -614,24 +683,10 @@
   private ServletRequest              _servletRequest;
   private ServletResponse             _servletResponse;
   private Map<String, Object>         _sessionMap;
-  private static final String         _INIT_PARAMETER_MAP_ATTRIBUTE = ServletInitParameterMap.class
-                                                                       .getName();
+  private static final String         _INIT_PARAMETER_MAP_ATTRIBUTE =
+      ServletInitParameterMap.class.getName();
   private static final String         _CHAR_ENCODING_CALLED = 
     ServletExternalContext.class.getName() + ".CHAR_ENCODING_CALLED";
-  private static final TrinidadLogger _LOG                          = TrinidadLogger
-                                                                       .createTrinidadLogger(ServletExternalContext.class);
-  private static Method               _setCharacterEncodingMethod   = null;
-  static
-  {
-    try
-    {
-      _setCharacterEncodingMethod = ServletRequest.class.getMethod("setCharacterEncoding",
-          new Class[] { String.class });
-    }
-    catch (final Exception e)
-    {
-      _LOG.warning("REQUEST_CHARACTER_ENCODING_DIABLED");
-      _LOG.warning("FAIL_OBTAIN_SERVLETREQUEST_METHOD", e);
-    }
-  }
+  private static final TrinidadLogger _LOG
+      = TrinidadLogger.createTrinidadLogger(ServletExternalContext.class);
 }

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletRequestHeaderMap.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletRequestHeaderMap.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletRequestHeaderMap.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletRequestHeaderMap.java Mon Nov 12 13:03:17 2007
@@ -27,9 +27,9 @@
  *
  * @version $Revision: 278654 $ $Date: 2005-09-04 18:32:35 -0600 (Sun, 04 Sep 2005) $
  */
-class ServletRequestHeaderMap extends AbstractAttributeMap<String, String>
+public class ServletRequestHeaderMap extends AbstractAttributeMap<String, String>
 {
-  ServletRequestHeaderMap(final HttpServletRequest httpServletRequest)
+  public ServletRequestHeaderMap(final HttpServletRequest httpServletRequest)
   {
     _httpServletRequest = httpServletRequest;
   }

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletRequestHeaderValuesMap.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletRequestHeaderValuesMap.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletRequestHeaderValuesMap.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/context/external/ServletRequestHeaderValuesMap.java Mon Nov 12 13:03:17 2007
@@ -32,9 +32,9 @@
  *
  * @version $Revision: 167257 $ $Date: 2004-10-13 05:51:02 -0600 (Wed, 13 Oct 2004) $
  */
-class ServletRequestHeaderValuesMap extends AbstractAttributeMap<String, String[]>
+public class ServletRequestHeaderValuesMap extends AbstractAttributeMap<String, String[]>
 {
-  ServletRequestHeaderValuesMap(final HttpServletRequest httpServletRequest)
+  public ServletRequestHeaderValuesMap(final HttpServletRequest httpServletRequest)
   {
     _httpServletRequest = httpServletRequest;
   }

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/convert/DateTimeConverter.java Mon Nov 12 13:03:17 2007
@@ -35,7 +35,7 @@
 import javax.faces.context.FacesContext;
 import javax.faces.convert.Converter;
 import javax.faces.convert.ConverterException;
-import javax.faces.el.ValueBinding;
+import javax.el.ValueExpression;
 
 import org.apache.myfaces.trinidad.context.RenderingContext;
 import org.apache.myfaces.trinidad.convert.ClientConverter;
@@ -112,10 +112,10 @@
       UIComponent component, String strValue, Object value)
   {
     assert value != null;
-    ValueBinding binding = component.getValueBinding("value");
-    if (binding != null)
+    ValueExpression expression = component.getValueExpression("value");
+    if (expression != null)
     {
-      Class<?> expectedType = binding.getType(context);
+      Class<?> expectedType = expression.getType(context.getELContext());
       // Sometimes the type might be null, if it cannot be determined:
       if ((expectedType != null)
           && (!expectedType.isAssignableFrom(value.getClass())))
@@ -162,10 +162,8 @@
     if (clientId != null)
     {
       // =-=AEW Only if Javascript...
-      // -= Simon Lessard =-
-      // FIXME: JSF 1.2 specifies <String, Object>
-      Map<Object, Object> requestMap = context.getExternalContext()
-          .getRequestMap();
+      Map<String, Object> requestMap =
+        context.getExternalContext().getRequestMap();
 
       // this fetch could be at the place where we append, but has been
       // moved ahead to optimize use of StringBuilder
@@ -545,7 +543,7 @@
 
   // RenderingContext key indicating the _dateFormat object
   // has been created
-  private static final Object _PATTERN_WRITTEN_KEY = "org.apache.myfaces.trinidadinternal.convert.DateTimeConverter._PATTERN_WRITTEN";
+  private static final String _PATTERN_WRITTEN_KEY = "org.apache.myfaces.trinidadinternal.convert.DateTimeConverter._PATTERN_WRITTEN";
 
   // String indicating that NO_JS_PATTERN is available
   private static final String _NO_JS_PATTERN = new String();

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/AccessKeyPropertyTagRule.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/AccessKeyPropertyTagRule.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/AccessKeyPropertyTagRule.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/AccessKeyPropertyTagRule.java Mon Nov 12 13:03:17 2007
@@ -22,7 +22,6 @@
 import java.lang.reflect.Method;
 
 import com.sun.facelets.FaceletContext;
-import com.sun.facelets.el.LegacyValueBinding;
 import com.sun.facelets.tag.Metadata;
 import com.sun.facelets.tag.MetadataTarget;
 import com.sun.facelets.tag.MetaRule;
@@ -31,8 +30,6 @@
 
 import javax.el.ValueExpression;
 
-import javax.faces.el.ValueBinding;
-
 import org.apache.myfaces.trinidad.bean.FacesBean;
 import org.apache.myfaces.trinidad.bean.PropertyKey;
 import org.apache.myfaces.trinidad.component.UIXComponent;
@@ -65,7 +62,6 @@
     public void applyMetadata(FaceletContext ctx, Object instance)
     {
       ValueExpression expr = _attribute.getValueExpression(ctx, String.class);
-      ValueBinding vb = new LegacyValueBinding(expr);
       UIXComponent uixcomp = (UIXComponent) instance;
       FacesBean bean = uixcomp.getFacesBean();
       PropertyKey mainKey = bean.getType().findKey(_mainMethodName);
@@ -77,7 +73,7 @@
       if (accessKeyKey == null)
         throw new TagAttributeException(_attribute,
                                         "No support for 'accessKey' attribute on " + instance);
-      VirtualAttributeUtils.setAccessKeyAttribute(bean, vb, mainKey, accessKeyKey);
+      VirtualAttributeUtils.setAccessKeyAttribute(bean, expr, mainKey, accessKeyKey);
     }
 
     private final String       _mainMethodName;

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/FileDownloadActionListenerTag.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/FileDownloadActionListenerTag.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/FileDownloadActionListenerTag.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/FileDownloadActionListenerTag.java Mon Nov 12 13:03:17 2007
@@ -33,8 +33,6 @@
 
 import com.sun.facelets.FaceletContext;
 import com.sun.facelets.FaceletException;
-import com.sun.facelets.el.LegacyMethodBinding;
-import com.sun.facelets.el.LegacyValueBinding;
 import com.sun.facelets.tag.TagAttribute;
 import com.sun.facelets.tag.TagConfig;
 import com.sun.facelets.tag.TagHandler;
@@ -54,7 +52,6 @@
     _method = getRequiredAttribute("method");
   }
 
-  @SuppressWarnings("deprecation")
   public void apply(FaceletContext faceletContext,
           UIComponent parent) throws IOException, FacesException, FaceletException, ELException
   {
@@ -69,8 +66,8 @@
         {
           ValueExpression valueExp = _filename.getValueExpression(faceletContext,
                                                                   Object.class);
-          listener.setValueBinding(FileDownloadActionListener.FILENAME_KEY,
-                                   new LegacyValueBinding(valueExp));
+          listener.setValueExpression(FileDownloadActionListener.FILENAME_KEY,
+                                     valueExp);
         }
       }
 
@@ -82,15 +79,15 @@
         {
           ValueExpression valueExp = _contentType.getValueExpression(faceletContext,
                                                                   Object.class);
-          listener.setValueBinding(FileDownloadActionListener.CONTENT_TYPE_KEY,
-                                   new LegacyValueBinding(valueExp));
+          listener.setValueExpression(FileDownloadActionListener.CONTENT_TYPE_KEY,
+                                      valueExp);
         }
       }
       
       MethodExpression me = _method.getMethodExpression(faceletContext,
                                                         Object.class,
                                                         _METHOD_PARAMS);
-      listener.setMethod(new LegacyMethodBinding(me));
+      listener.setMethod(me);
 
       ActionSource actionSource = (ActionSource)parent;
       actionSource.addActionListener(listener);

Modified: myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java?rev=594297&r1=594296&r2=594297&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java (original)
+++ myfaces/trinidad/branches/1.2.4-branch/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/facelets/ReturnActionListenerTag.java Mon Nov 12 13:03:17 2007
@@ -59,9 +59,8 @@
       if (_value != null)
       {
         ValueExpression valueExp = _value.getValueExpression(faceletContext, Object.class);
-        listener.setValueBinding(ReturnActionListener.VALUE_KEY, new LegacyValueBinding(valueExp));
+        listener.setValueExpression(ReturnActionListener.VALUE_KEY,valueExp);
       }
-
 
       actionSource.addActionListener(listener);
     }