[
https://issues.apache.org/jira/browse/WW-3476?focusedWorklogId=1046794&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1046794
]
ASF GitHub Bot logged work on WW-3476:
--------------------------------------
Author: ASF GitHub Bot
Created on: 10/Oct/26 16:06
Start Date: 10/Oct/26 16:06
Worklog Time Spent: 10m
Work Description: lukaszlenart commented on code in PR #2005:
URL: https://github.com/apache/struts/pull/2005#discussion_r4238252699
##########
core/src/main/java/org/apache/struts2/config/entities/PackageConfig.java:
##########
@@ -90,6 +94,8 @@ protected PackageConfig(PackageConfig orig) {
this.parents = new ArrayList<>(orig.parents);
this.location = orig.location;
this.strictMethodInvocation = orig.strictMethodInvocation;
+ this.scopedConstants = new LinkedHashMap<>(orig.scopedConstants);
+ this.allScopedConstants = orig.allScopedConstants;
Review Comment:
Same here, unmodifiable map?
##########
core/src/main/java/org/apache/struts2/config/entities/PackageConfig.java:
##########
@@ -90,6 +94,8 @@ protected PackageConfig(PackageConfig orig) {
this.parents = new ArrayList<>(orig.parents);
this.location = orig.location;
this.strictMethodInvocation = orig.strictMethodInvocation;
+ this.scopedConstants = new LinkedHashMap<>(orig.scopedConstants);
Review Comment:
Can this be unmodifiable map?
##########
core/src/main/java/org/apache/struts2/config/StrutsScopedConstantProvider.java:
##########
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.struts2.config;
+
+import org.apache.struts2.ActionContext;
+import org.apache.struts2.ActionInvocation;
+import org.apache.struts2.ActionProxy;
+import org.apache.struts2.config.entities.PackageConfig;
+import org.apache.struts2.inject.Container;
+import org.apache.struts2.inject.Inject;
+
+import java.util.Optional;
+import java.util.Set;
+
+/**
+ * @since 7.5.0
+ */
+public class StrutsScopedConstantProvider implements ScopedConstantProvider {
+
+ private Container container;
+ private Configuration configuration;
+ private volatile Set<String> scopableNames;
+
+ @Inject
+ public void setContainer(Container container) {
+ this.container = container;
+ }
+
+ @Inject
+ public void setConfiguration(Configuration configuration) {
+ this.configuration = configuration;
+ }
Review Comment:
Why do we need to inject both? Injecting container and then obtaining
configuration out of it should be ok
Issue Time Tracking
-------------------
Worklog Id: (was: 1046794)
Time Spent: 0.5h (was: 20m)
> Allow overwriting of constants for each package
> -----------------------------------------------
>
> Key: WW-3476
> URL: https://issues.apache.org/jira/browse/WW-3476
> Project: Struts 2
> Issue Type: New Feature
> Components: XML Configuration
> Affects Versions: 2.2.1
> Reporter: Johannes Geppert
> Assignee: Lukasz Lenart
> Priority: Major
> Fix For: 7.5.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Allow to overwriting of constants for each package.
> So I can specify as example for each package an other ActionMapper, Local or
> other location for the JSP Files.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)