Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-5093

inconsistent scope for variables created with s:set and s:url

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.5.22
    • 2.6
    • Core Tags

    Description

      The implementation of s:set and s:url and s:text is not consistent and not well documented. 

      Creating a variable with s:set puts the variable in a different default scope than creating a variable with s:url or s:text (with the attribute var). It is also not documented what the default scope is. After testing I could conclude that the scope for a variable created by s:url is request, while the default of s:set is not. Furthermore, s:set offers a possibility to specify the scope with an attribute, But s:url and s:text do not. 

      Possible options would be offering the possibility to specify the scope attribute in s:url and s:text, or dropping support for the var attribute for s:url and s:text and only allow s:set to create variables (thus being forced to nest s:url and s:text inside an s:set). That would be symmetric with how s:property does not offer the var attribute. At minimum all three tags should have the same default and their default should be explicitly specified in the documentation (in the tld and the online manual / tag reference)

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              nikos nikos dimitrakas
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m