struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4713) Drop "searchValueStack" attribute from tag <s:text/>
Date Sat, 11 Nov 2017 15:25:00 GMT

    [ https://issues.apache.org/jira/browse/WW-4713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16248552#comment-16248552
] 

ASF GitHub Bot commented on WW-4713:
------------------------------------

lukaszlenart closed pull request #184: WW-4713 Added deprecation warnings as preparation to
drop searchValue…
URL: https://github.com/apache/struts/pull/184
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/java/org/apache/struts2/components/Text.java b/core/src/main/java/org/apache/struts2/components/Text.java
index a5ea21715..8ce179ff4 100644
--- a/core/src/main/java/org/apache/struts2/components/Text.java
+++ b/core/src/main/java/org/apache/struts2/components/Text.java
@@ -123,6 +123,7 @@
     protected List<Object> values = Collections.emptyList();
     protected String actualName;
     protected String name;
+    @Deprecated
     protected String searchStack;
     private boolean escapeHtml = false;
     private boolean escapeJavaScript = false;
@@ -138,6 +139,7 @@ public void setName(String name) {
         this.name = name;
     }
 
+    @Deprecated
     @StrutsTagAttribute(description="Search the stack if property is not found on resources",
type = "Boolean", defaultValue = "false")
     public void setSearchValueStack(String searchStack) {
         this.searchStack = searchStack;
diff --git a/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java b/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
index 5200844c1..145f6c006 100644
--- a/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
+++ b/core/src/main/java/org/apache/struts2/util/TextProviderHelper.java
@@ -62,7 +62,10 @@ public static String getText(String key, String defaultMessage, List<Object>
arg
      * @param searchStack     search stack for the key
      *
      * @return the message if found, otherwise the defaultMessage
+     *
+     * @deprecated The stack should never be searched for the key. Use the version without
the searchStack boolean instead.
      */
+    @Deprecated
     public static String getText(String key, String defaultMessage, List<Object> args,
ValueStack stack, boolean searchStack) {
         String msg = null;
         TextProvider tp = null;
diff --git a/core/src/main/java/org/apache/struts2/views/jsp/TextTag.java b/core/src/main/java/org/apache/struts2/views/jsp/TextTag.java
index c0420dfad..b47e8e0e4 100644
--- a/core/src/main/java/org/apache/struts2/views/jsp/TextTag.java
+++ b/core/src/main/java/org/apache/struts2/views/jsp/TextTag.java
@@ -34,6 +34,7 @@
     private static final long serialVersionUID = -3075088084198264581L;
 
     protected String name;
+    @Deprecated
     protected String searchValueStack;
     private boolean escapeHtml = false;
     private boolean escapeJavaScript = false;
@@ -60,6 +61,7 @@ public void setName(String name) {
         this.name = name;
     }
 
+    @Deprecated
     public void setSearchValueStack(String searchStack) {
         this.searchValueStack = searchStack;
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Drop "searchValueStack" attribute from tag <s:text/>
> ----------------------------------------------------
>
>                 Key: WW-4713
>                 URL: https://issues.apache.org/jira/browse/WW-4713
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Core Tags
>    Affects Versions: 2.5.8
>            Reporter: Lukasz Lenart
>            Assignee: Stefaan Dutry
>             Fix For: 2.6
>
>
> This attribute is only used to evaluate a {{defaultMessage}} against a ValueStack which
is useless in most cases as the {{defaultMessage}} should be a static text, not an expression.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message