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

Access to request attributes via tags is broken

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 6.2.0
    • 6.3.0
    • Core Tags
    • None

    Description

      Accessing request attributes no longer works consistently in 6.2.0.  If you have the following code:

      <%@ page contentType="text/html; charset=UTF-8" %>
      <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
      <%@ taglib prefix="s" uri="/struts-tags" %>
      <html>
          <head>
              <title><s:text name="hello.message"/></title>
          </head>

          <body>
              <c:set var="first" value="success" scope="request" />
              <p>Set attempt #1: <s:property value="#request.first" /></p>

              <c:set var="second" value="success" scope="request" />
              <p>Set attempt #2: <s:property value="#request.second" /></p>
          </body>
      </html>

       

      On 6.1.2.1 you get:

      Set attempt #1: success
      Set attempt #2: success

      But on 6.2.0 you only get: 

      Set attempt #1: success
      Set attempt #2: 

       

      Related to: WW-5196

      Change

      public Object get(final String key) {
          return request.getAttribute(key);
      }

      to:

      public Object get(final Object key) {
          return request.getAttribute(key.toString());
      }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wtellis Wyatt Tellis
              Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 1h 40m
                  1h 40m