You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/09/03 06:12:00 UTC

[jira] [Commented] (WW-4954) xml-validation fails since struts 2.5.17

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

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

lukaszlenart closed pull request #246: Better logging message (for WW-4954)
URL: https://github.com/apache/struts/pull/246
 
 
   

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/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
index 9a04eacce..2002669f2 100644
--- a/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
+++ b/core/src/main/java/com/opensymphony/xwork2/ognl/SecurityMemberAccess.java
@@ -81,29 +81,31 @@ public void restore(Map context, Object target, Member member, String propertyNa
     @Override
     public boolean isAccessible(Map context, Object target, Member member, String propertyName) {
         LOG.debug("Checking access for [target: {}, member: {}, property: {}]", target, member, propertyName);
-
+        
+        Class targetClass = target.getClass();
+        Class memberClass = member.getDeclaringClass();
+        
         if (checkEnumAccess(target, member)) {
-            LOG.trace("Allowing access to enum: {}", target);
+            LOG.trace("Allowing access to enum: target class [{}] of target [{}], member [{}]", targetClass, target, member);
             return true;
         }
 
-        Class targetClass = target.getClass();
-        Class memberClass = member.getDeclaringClass();
-
         if (Modifier.isStatic(member.getModifiers()) && allowStaticMethodAccess) {
-            LOG.debug("Support for accessing static methods [target: {}, member: {}, property: {}] is deprecated!", target, member, propertyName);
+            LOG.debug("Support for accessing static methods [target: {}, targetClass: {}, member: {}, property: {}] is deprecated!",
+                    target, targetClass, member, propertyName);
             if (!isClassExcluded(member.getDeclaringClass())) {
                 targetClass = member.getDeclaringClass();
             }
         }
 
         if (isPackageExcluded(targetClass.getPackage(), memberClass.getPackage())) {
-            LOG.warn("Package of target [{}] or package of member [{}] are excluded!", target, member);
+            LOG.warn("Package [{}] of target class [{}] of target [{}] or package [{}] of member [{}] are excluded!", targetClass.getPackage(), targetClass,
+                    target, memberClass.getPackage(), member);
             return false;
         }
 
         if (isClassExcluded(targetClass)) {
-            LOG.warn("Target class [{}] is excluded!", target);
+            LOG.warn("Target class [{}] of target [{}] is excluded!", targetClass, target);
             return false;
         }
 
@@ -113,7 +115,7 @@ public boolean isAccessible(Map context, Object target, Member member, String pr
         }
 
         if (disallowProxyMemberAccess && ProxyUtil.isProxyMember(member, target)) {
-            LOG.warn("Access to proxy [{}] is blocked!", member);
+            LOG.warn("Access to proxy is blocked! Target class [{}] of target [{}], member [{}]", targetClass, target, member);
             return false;
         }
 


 

----------------------------------------------------------------
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


> xml-validation fails since struts 2.5.17
> ----------------------------------------
>
>                 Key: WW-4954
>                 URL: https://issues.apache.org/jira/browse/WW-4954
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.5.17
>            Reporter: Fechner
>            Assignee: Lukasz Lenart
>            Priority: Major
>             Fix For: 2.6, 2.3.36, 2.5.18
>
>         Attachments: KundenAction-kundenAdrUebernehmen-validation.xml, KundenAction-kundenAdrUebernehmen-validation.xml, KundenAction-kundenAdrUebernehmen-validation.xml.alt, KundenAction.java, ValidatorArrayListSize.java, ValidatorArrayListSize.java, email_festnetz_email-arrayListStringeSize_festnetz-arrayListStringeSize_otherinvalideValues.png, email_festnetz_email-arrayListStringeSize_festnetz-fieldexpression.png, email_festnetz_email-fieldexpression_festnetz-fieldexpression.png, kundenNeuanlegenAdresse.jspf, kundenVerwaltung.xml, mitarbeiterVerwaltung.xml, produktVerwaltung.xml, struts.xml
>
>
> xml-Validation of "s:optiontransferselect" and "s:inputtransferselect" fails since version 2.5.17.
> Until version 2.5.16 xml-validation works fine.
> Example :
> inputtransferselect:
> {code:xml}
>  <s:inputtransferselect
>                                  label="%\{getText('adresse.email')}"
>                                  name="kuAnschrift.kontaktMittel.eingabeEmailAdresse"
>                                  list="kuAnschrift.kontaktMittel.eingabeEmailAdresse"
>                                  id="eingabeEmailAdresseKuAnschrift"
>                                  cssClass="inputoptionselect"
>                                  addLabel="%\{getText('add')}"
>                                  removeLabel="%\{getText('remove')}"
>                                  removeAllLabel="%\{getText('removeAll')}"
>                                  buttonCssClass="navibutton"
>                                  allowUpDown="false"
>                                  requiredLabel="true"
>                                  tooltip="%\{getText('tooltip.adresse.email')}"
>                                  tooltipIconPath="/images/question.gif"
>                          />
> {code}
> {code}
> <!DOCTYPE validators PUBLIC "-//Apache Struts//XWork Validator 1.0.3//EN"
>         "../../../../xwork-validator-1.0.3.dtd">
>  <validators>
> ....
>         <field name="kuAnschrift.kontaktMittel.eingabeEmailAdresse">
>            <field-validator type="fieldexpression">
>                <param name="expression">
>                    <![CDATA[ kuAnschrift.kontaktMittel.eingabeEmailAdresse.size() > 0 ]]>
>                </param>
>                <message key="mindestens eine Email" />
>            </field-validator>
>            <field-validator type="email">
>                 <message key="emailfalsch" />
>            </field-validator>
>         </field>  
>  ....
>  </validators>
> {code}
> optiontransferselect:
> {code:xml}
> <s:fielderror fieldName="selectedIdListe" />    
> <s:optiontransferselect
>         id="idListe"
>         label="%\{getText('pk.klasse.gebiet')}"
>         name="idListe"
>         leftTitle="%\{getText('produkt.ag.links')}"
>         rightTitle="%\{getText('produkt.ag.rechts')}"
>         list="%\{#session.listeLinks}"
>         listKey="id"
>         listValue="anzeige"
>         multiple="true"
>         size="15"
>         cssClass="input_text"
>         requiredLabel="true" 
>     
>         buttonCssClass="navibutton"
>         allowSelectAll="false"
>         allowUpDownOnLeft="false"
>         allowUpDownOnRight="false"
>         allowAddAllToLeft="false"
>         allowAddAllToRight="false"
>         addToLeftLabel="%\{getText('remove')}"
>         addToRightLabel="%\{getText('add')}"
>         doubleList="%\{#session.listeRechts}"
>         doubleListKey="id"
>         doubleListValue="anzeige"
>         doubleName="selectedIdListe"
>         doubleSize="15"
>         doubleCssClass="input_text"
> />
> {code}
> I hope You can helb
> Best regards
>  Siegfried Fechner
>   



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)