ICEfaces
  1. ICEfaces
  2. ICE-2551

JSP parser discards <f:view> attributes

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7DR#3
    • Fix Version/s: 1.7Beta1, 1.7
    • Component/s: Framework
    • Labels:
      None
    • Environment:
      JSP (not Facelets)

      Description

      When using ICE-2419's test application, I found that com.icesoft.faces.webapp.parser.ComponentRuleSet.addRuleInstances(Digester) has a special case for <f:view>, where it doesn't actually save what was parsed into a TagWire. This is because com.icesoft.faces.webapp.parser.Parser.parse(Reader,FacesContext) just makes a new TagWire for the <f:view>, and forces it to be the root TagWire. This means that any attributes on the <f:view> tag are discarded, including the locale attribute.

      We have to add a rule to the Digester, to get it to save the attributes somewhere, where they can be put into the made root TagWire. Then, I believe that ViewTag will have its locale attribute, and be able to set it on the UIViewRoot.

        Issue Links

          Activity

          Mark Collette created issue -
          Mark Collette made changes -
          Field Original Value New Value
          Fix Version/s 1.7 [ 10080 ]
          Assignee Priority P1
          Assignee Mark Collette [ mark.collette ]
          Ken Fyten made changes -
          Assignee Priority P1
          Assignee Mark Collette [ mark.collette ] Greg Dick [ greg.dick ]
          Michael Thiem made changes -
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15698 Thu Jan 31 13:25:52 MST 2008 greg.dick ICE-2551 parse ViewTag instance and maintain the attributes for locale
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/StubPageContext.java
          Commit graph ADD /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/StubHttpServletRequest.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/ComponentRuleSet.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/Parser.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/ELSetPropertiesRule.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/JsfJspDigester.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/TagWire.java
          Hide
          Greg Dick added a comment -

          The way this was working is as follows.

          The code manually creates a fake root Tag. We have this TagWire class designed to represent the relationship between a tag and its children because the Tag itself knows nothing of this.

          The original code skipped over setting up a digester rule for the ViewTag, and manually create a fake ViewTag after parsing was done, and re-parented the Tag hierarchy on this ViewTag. This worked, but it obviously ignored any attributes on the original page ViewTag.

          I added a custom tagRule for the ViewTag, as well as used the ELSetPropertiesRule to set the locale on the UIViewRoot tag. Currently there is no way to know where the ViewRoot is located in the document, so I had to re-engineer the tag hierarchy after parsing to move the parsed Tag up to the parent, and to replace it in the tree with its children. I would have preferred to simply capture the attributes from the ViewTag, and set these in a manually-generated viewTag at the root as before, but if the ViewTag is not digested, then the attributes can't be captured, and if they are digested, I got an IllegalState Exception when I tried to execute the JSP lifecycle.

          So for now, we parse the Tags, and move them around afterward. Normally, in a pure JSF realm, there are no tags outside the <f:view> tag, only static text (from a jsp point of view). However, in ICEfaces, any/all xhtml tags are also treated as Tags, which necessitates our having to do anything at all to 'put' the ViewTag at the top of the tree in the first place.

          The ViewTag class (JSF) does some weird stuff to the JSTL core library with the locale, hence the need to create a stubRequestObject and modifying the StubPageContext to support the new StubRequest.

          Show
          Greg Dick added a comment - The way this was working is as follows. The code manually creates a fake root Tag. We have this TagWire class designed to represent the relationship between a tag and its children because the Tag itself knows nothing of this. The original code skipped over setting up a digester rule for the ViewTag, and manually create a fake ViewTag after parsing was done, and re-parented the Tag hierarchy on this ViewTag. This worked, but it obviously ignored any attributes on the original page ViewTag. I added a custom tagRule for the ViewTag, as well as used the ELSetPropertiesRule to set the locale on the UIViewRoot tag. Currently there is no way to know where the ViewRoot is located in the document, so I had to re-engineer the tag hierarchy after parsing to move the parsed Tag up to the parent, and to replace it in the tree with its children. I would have preferred to simply capture the attributes from the ViewTag, and set these in a manually-generated viewTag at the root as before, but if the ViewTag is not digested, then the attributes can't be captured, and if they are digested, I got an IllegalState Exception when I tried to execute the JSP lifecycle. So for now, we parse the Tags, and move them around afterward. Normally, in a pure JSF realm, there are no tags outside the <f:view> tag, only static text (from a jsp point of view). However, in ICEfaces, any/all xhtml tags are also treated as Tags, which necessitates our having to do anything at all to 'put' the ViewTag at the top of the tree in the first place. The ViewTag class (JSF) does some weird stuff to the JSTL core library with the locale, hence the need to create a stubRequestObject and modifying the StubPageContext to support the new StubRequest.
          Greg Dick made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Fix Version/s 1.7Beta1 [ 10121 ]
          Fix Version/s 1.7 [ 10080 ]
          Resolution Fixed [ 1 ]
          Repository Revision Date User Message
          ICEsoft Public SVN Repository #15706 Fri Feb 01 14:53:42 MST 2008 ted.goddard added fallback case for pages without view tag (ICE-2551)
          Files Changed
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/ComponentRuleSet.java
          Commit graph MODIFY /icefaces/trunk/icefaces/core/src/com/icesoft/faces/webapp/parser/Parser.java
          Ken Fyten made changes -
          Link This issue blocks ICE-836 [ ICE-836 ]
          Ken Fyten made changes -
          Summary Our JSP parser discards <f:view> attributes JSP parser discards <f:view> attributes
          Issue Type Bug [ 1 ] Improvement [ 4 ]
          Affects [Compatibility/Configuration]
          Ken Fyten made changes -
          Fix Version/s 1.7 [ 10080 ]
          Ken Fyten made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Assignee Greg Dick [ greg.dick ]
          Frank Ye made changes -
          Link This issue blocks ICE-2667 [ ICE-2667 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Mark Collette
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: