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

          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.

            People

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

              Dates

              • Created:
                Updated:
                Resolved: