[
https://issues.apache.org/jira/browse/WW-5331?focusedWorklogId=877153&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-877153
]
ASF GitHub Bot logged work on WW-5331:
--------------------------------------
Author: ASF GitHub Bot
Created on: 20/Aug/23 11:06
Start Date: 20/Aug/23 11:06
Worklog Time Spent: 10m
Work Description: kusalk commented on code in PR #727:
URL: https://github.com/apache/struts/pull/727#discussion_r1299357276
##########
core/src/main/java/org/apache/struts2/dispatcher/ApplicationMap.java:
##########
@@ -117,12 +117,15 @@ public Object setValue(final Object obj) {
* @param key the entry key.
* @return the servlet context attribute or init parameter or
<tt>null</tt> if the entry is not found.
*/
- public Object get(final String key) {
+ public Object get(final Object key) {
Review Comment:
Add Override annotation as per Sonar, otherwise LGTM
Issue Time Tracking
-------------------
Worklog Id: (was: 877153)
Time Spent: 1h 10m (was: 1h)
> Access to request attributes via tags is broken
> -----------------------------------------------
>
> Key: WW-5331
> URL: https://issues.apache.org/jira/browse/WW-5331
> Project: Struts 2
> Issue Type: Bug
> Components: Core Tags
> Affects Versions: 6.2.0
> Reporter: Wyatt Tellis
> Priority: Major
> Fix For: 6.3.0
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> 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());}}
> {{}}}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)