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

Dynamic Method Invocation, validator with ActionName-aliasName-validation.xml files.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: 2.0.6
    • Fix Version/s: 2.3.12
    • Component/s: Core Actions
    • Labels:
      None
    • Environment:

      Fedora 4, tomcat

      Description

      Hello,
      I have been trying to get validation working with dynamic method invocation, using ActionName-aliasName-validation.xml files.

      When the struts.property is set >> struts.enable.DynamicMethodInvocation=true, in the DefaultActionMapper the mapping name is changed by removing !submit from the action eg fieldValidatorsExamples!submit becomes fieldValidatorsExamples. When the validator tries to find FieldValidatorsExampleAction-fieldValidatorsExamples!submit-validator.xml it cannot, as the validator is looking for FieldValidatorsExampleAction-fieldValidatorsExamples-validator.xml. But this is now not linked to a method.

      if (allowDynamicMethodCalls) {
          // handle "name!method" convention.
          String name = mapping.getName();
          int exclamation = name.lastIndexOf("!");
          if (exclamation != -1) {
              mapping.setName(name.substring(0, exclamation)); 
              mapping.setMethod(name.substring(exclamation + 1));
          }
      }
      

      With struts.enable.DynamicMethodInvocation=false, validator works but method name is null.

      This line of code is causing the problem mapping.setName(name.substring(0, exclamation));. Without this line seems to work but I am no expert!

      eg:

      <action name="fieldValidatorsExamples!*" class="org.apache.struts2.showcase.validation.FieldValidatorsExampleAction" method="{1}" >
          <result name="input" type="dispatcher">/validation/fieldValidatorsExample.jsp</result>
          <result type="dispatcher">/validation/successFieldValidatorsExample.jsp</result>
      </action>
      
      <s:form action="fieldValidatorsExamples!submit" namespace="/validation" method="POST" theme="xhtml">
          <s:textfield label="Required Validator Field" name="requiredValidatorField" />
          <s:textfield label="Required String Validator Field" name="requiredStringValidatorField" />
          <s:textfield label="Integer Validator Field" name="integerValidatorField" />
          <s:textfield label="Date Validator Field" name="dateValidatorField" />
          <s:textfield label="Email Validator Field" name="emailValidatorField" />
          <s:textfield label="URL Validator Field" name="urlValidatorField" />
          <s:textfield label="String Length Validator Field" name="stringLengthValidatorField" />
          <s:textfield label="Regex Validator Field" name="regexValidatorField"/>
          <s:textfield label="Field Expression Validator Field" name="fieldExpressionValidatorField" />
          <s:submit label="Submit" />
      </s:form>
      

      Cheers Greg

      1. patch_WW-1967_xwork_2.txt
        5 kB
        Greg Huber
      2. patch_WW-1967.txt
        1 kB
        Greg Huber

        Activity

        Hide
        husted Ted Husted added a comment -

        Setting Fix Version to "future" for issues without a set fix version.

        Show
        husted Ted Husted added a comment - Setting Fix Version to "future" for issues without a set fix version.
        Hide
        mrdon Don Brown added a comment -

        Well, first of all, if you are using dynamic method invocation, you don't need wildcards in that way in the action mapping. Try taking those out and see if you still are having difficulties.

        Show
        mrdon Don Brown added a comment - Well, first of all, if you are using dynamic method invocation, you don't need wildcards in that way in the action mapping. Try taking those out and see if you still are having difficulties.
        Hide
        ghuber Greg Huber added a comment -

        Don, Not sure what you mean.

        For:

        http://172.17.30.43:8080/Events/user/eventEdit!save.action

        public class EventEdit extends EventBase {
        public String save() {
        {
        }

        If I change:

        <action name="eventEdit!*" method="

        {1}"
        class="test..EventEdit">
        <result name="input" type="tiles">.EventEdit</result>
        <result name="cancel" type="redirect-action">
        <param name="actionName">events</param>
        <param name="parse">true</param>
        <param name="pgn">${bean.pageNum}</param>
        </result>
        <result name="error" type="chain">events</result>
        </action>

        to: (remove the * from !*)

        <action name="eventEdit!" method="{1}

        "
        class="test.EventEdit">
        <result name="input" type="tiles">.EventEdit</result>
        <result name="cancel" type="redirect-action">
        <param name="actionName">events</param>
        <param name="parse">true</param>
        <param name="pgn">$

        {bean.pageNum}

        </param>
        </result>
        <result name="error" type="chain">events</result>
        </action>

        I now get this error:
        Struts has detected an unhandled exception:

        1. Messages: There is no Action mapped for namespace /user and action name eventEdit.

        Is there anything else I need to change? Thought the * was to match any method in class EventEdit?

        Show
        ghuber Greg Huber added a comment - Don, Not sure what you mean. For: http://172.17.30.43:8080/Events/user/eventEdit!save.action public class EventEdit extends EventBase { public String save() { { } If I change: <action name="eventEdit!*" method=" {1}" class="test..EventEdit"> <result name="input" type="tiles">.EventEdit</result> <result name="cancel" type="redirect-action"> <param name="actionName">events</param> <param name="parse">true</param> <param name="pgn">${bean.pageNum}</param> </result> <result name="error" type="chain">events</result> </action> to: (remove the * from !*) <action name="eventEdit!" method="{1} " class="test.EventEdit"> <result name="input" type="tiles">.EventEdit</result> <result name="cancel" type="redirect-action"> <param name="actionName">events</param> <param name="parse">true</param> <param name="pgn">$ {bean.pageNum} </param> </result> <result name="error" type="chain">events</result> </action> I now get this error: Struts has detected an unhandled exception: Messages: There is no Action mapped for namespace /user and action name eventEdit. Is there anything else I need to change? Thought the * was to match any method in class EventEdit?
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Waiting for path from [~gregh99] as mentioned in WW-3965

        Show
        lukaszlenart Lukasz Lenart added a comment - Waiting for path from [~gregh99] as mentioned in WW-3965
        Hide
        ghuber Greg Huber added a comment -

        Sorry, attached it to WW-3965!

        Cheers Greg.

        Show
        ghuber Greg Huber added a comment - Sorry, attached it to WW-3965 ! Cheers Greg.
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        What about changing logic a bit and if DMI is enabled build file name like this ActionName-aliasName_method-validation.xml ?

        Show
        lukaszlenart Lukasz Lenart added a comment - What about changing logic a bit and if DMI is enabled build file name like this ActionName-aliasName_method-validation.xml ?
        Hide
        ghuber Greg Huber added a comment -

        For what I can remember (a long time ago!), if you remove the bang where would it get the method name _method from?

        eg the ww way:

        The action class is ResendPassword method sendRequest(..)
        The action name is resend.

        jsp
        <s:submit value="%

        {getText('button.resend')}

        " action="resend!sendRequest" />

        validation file:

        ResendPassword-resend!sendRequest-validation.xml

        So I only want the form checked when I run resend!sendRequest

        Does this help?

        Show
        ghuber Greg Huber added a comment - For what I can remember (a long time ago!), if you remove the bang where would it get the method name _method from? eg the ww way: The action class is ResendPassword method sendRequest(..) The action name is resend. jsp <s:submit value="% {getText('button.resend')} " action="resend!sendRequest" /> validation file: ResendPassword-resend!sendRequest-validation.xml So I only want the form checked when I run resend!sendRequest Does this help?
        Hide
        ghuber Greg Huber added a comment - - edited

        I have done some debugging on one of my actions:

        The class name is EventAdd, the method is save and the action is eventAdd

        action:eventAdd!save

        In the validation interceptor these are the file names it is looking for in the AnnotationActionValidatorManager class:

        UNMODIFIED DefaultActionMapper

        java/lang/Object-validation.xml
        java/lang/Object-eventAdd-validation.xml
        com/opensymphony/xwork2/Action-validation.xml
        com/opensymphony/xwork2/Action-eventAdd-validation.xml
        com/opensymphony/xwork2/Validateable-validation.xml
        com/opensymphony/xwork2/Validateable-eventAdd-validation.xml
        com/opensymphony/xwork2/ValidationAware-validation.xml
        com/opensymphony/xwork2/ValidationAware-eventAdd-validation.xml
        com/opensymphony/xwork2/TextProvider-validation.xml
        com/opensymphony/xwork2/TextProvider-eventAdd-validation.xml
        com/opensymphony/xwork2/LocaleProvider-validation.xml
        com/opensymphony/xwork2/LocaleProvider-eventAdd-validation.xml
        java/io/Serializable-validation.xml
        java/io/Serializable-eventAdd-validation.xml
        com/opensymphony/xwork2/ActionSupport-validation.xml
        com/opensymphony/xwork2/ActionSupport-eventAdd-validation.xml
        events/ui/struts2/editor/EventBase-validation.xml
        events/ui/struts2/editor/EventBase-eventAdd-validation.xml
        events/ui/struts2/editor/EventAdd-validation.xml
        events/ui/struts2/editor/EventAdd-eventAdd-validation.xml

        There is no method checking done for the save method on EventAdd.

        These are the file names it is looking for in the AnnotationActionValidatorManager class:

        MODIFIED DefaultActionMapper

        java/lang/Object-validation.xml
        java/lang/Object-eventAdd!save-validation.xml
        com/opensymphony/xwork2/Action-validation.xml
        com/opensymphony/xwork2/Action-eventAdd!save-validation.xml
        com/opensymphony/xwork2/Validateable-validation.xml
        com/opensymphony/xwork2/Validateable-eventAdd!save-validation.xml
        com/opensymphony/xwork2/ValidationAware-validation.xml
        com/opensymphony/xwork2/ValidationAware-eventAdd!save-validation.xml
        com/opensymphony/xwork2/TextProvider-validation.xml
        com/opensymphony/xwork2/TextProvider-eventAdd!save-validation.xml
        com/opensymphony/xwork2/LocaleProvider-validation.xml
        com/opensymphony/xwork2/LocaleProvider-eventAdd!save-validation.xml
        java/io/Serializable-validation.xml
        java/io/Serializable-eventAdd!save-validation.xml
        com/opensymphony/xwork2/ActionSupport-validation.xml
        com/opensymphony/xwork2/ActionSupport-eventAdd!save-validation.xml
        events/ui/struts2/editor/EventBase-validation.xml
        events/ui/struts2/editor/EventBase-eventAdd!save-validation.xml
        events/ui/struts2/editor/EventAdd-validation.xml
        events/ui/struts2/editor/EventAdd-eventAdd!save-validation.xml

        Which you can see that it is checking for the save method now.

        I guess the question is why does it not use the save method in the unmodified version (first)?

        Show
        ghuber Greg Huber added a comment - - edited I have done some debugging on one of my actions: The class name is EventAdd, the method is save and the action is eventAdd action:eventAdd!save In the validation interceptor these are the file names it is looking for in the AnnotationActionValidatorManager class: UNMODIFIED DefaultActionMapper java/lang/Object-validation.xml java/lang/Object-eventAdd-validation.xml com/opensymphony/xwork2/Action-validation.xml com/opensymphony/xwork2/Action-eventAdd-validation.xml com/opensymphony/xwork2/Validateable-validation.xml com/opensymphony/xwork2/Validateable-eventAdd-validation.xml com/opensymphony/xwork2/ValidationAware-validation.xml com/opensymphony/xwork2/ValidationAware-eventAdd-validation.xml com/opensymphony/xwork2/TextProvider-validation.xml com/opensymphony/xwork2/TextProvider-eventAdd-validation.xml com/opensymphony/xwork2/LocaleProvider-validation.xml com/opensymphony/xwork2/LocaleProvider-eventAdd-validation.xml java/io/Serializable-validation.xml java/io/Serializable-eventAdd-validation.xml com/opensymphony/xwork2/ActionSupport-validation.xml com/opensymphony/xwork2/ActionSupport-eventAdd-validation.xml events/ui/struts2/editor/EventBase-validation.xml events/ui/struts2/editor/EventBase-eventAdd-validation.xml events/ui/struts2/editor/EventAdd-validation.xml events/ui/struts2/editor/EventAdd-eventAdd-validation.xml There is no method checking done for the save method on EventAdd. These are the file names it is looking for in the AnnotationActionValidatorManager class: MODIFIED DefaultActionMapper java/lang/Object-validation.xml java/lang/Object-eventAdd!save-validation.xml com/opensymphony/xwork2/Action-validation.xml com/opensymphony/xwork2/Action-eventAdd!save-validation.xml com/opensymphony/xwork2/Validateable-validation.xml com/opensymphony/xwork2/Validateable-eventAdd!save-validation.xml com/opensymphony/xwork2/ValidationAware-validation.xml com/opensymphony/xwork2/ValidationAware-eventAdd!save-validation.xml com/opensymphony/xwork2/TextProvider-validation.xml com/opensymphony/xwork2/TextProvider-eventAdd!save-validation.xml com/opensymphony/xwork2/LocaleProvider-validation.xml com/opensymphony/xwork2/LocaleProvider-eventAdd!save-validation.xml java/io/Serializable-validation.xml java/io/Serializable-eventAdd!save-validation.xml com/opensymphony/xwork2/ActionSupport-validation.xml com/opensymphony/xwork2/ActionSupport-eventAdd!save-validation.xml events/ui/struts2/editor/EventBase-validation.xml events/ui/struts2/editor/EventBase-eventAdd!save-validation.xml events/ui/struts2/editor/EventAdd-validation.xml events/ui/struts2/editor/EventAdd-eventAdd!save-validation.xml Which you can see that it is checking for the save method now. I guess the question is why does it not use the save method in the unmodified version (first)?
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Could you prepare a small Maven based example?

        Show
        lukaszlenart Lukasz Lenart added a comment - Could you prepare a small Maven based example?
        Hide
        ghuber Greg Huber added a comment - - edited

        In class com.opensymphony.xwork2.validator.AnnotationActionValidatorManager buildAliasValidatorConfigs(..) it never adds the method name.

        private List<ValidatorConfig> buildAliasValidatorConfigs(Class aClass, String context, boolean checkFile) {
          String fileName = aClass.getName().replace('.', '/') + "-" + context.replace('/', '-') + VALIDATION_CONFIG_SUFFIX;
          return loadFile(fileName, aClass, checkFile);
        }
        

        I guess we need another method/modify which handles the bang/method name:

        private List<ValidatorConfig> buildAliasValidatorConfigs(Class aClass, String context, boolean checkFile) {
                
          ActionInvocation invocation = ActionContext.getContext().getActionInvocation();
          ActionProxy proxy = invocation.getProxy();
            	
          String fileName = aClass.getName().replace('.', '/') + "-" + context.replace('/', '-') +"!"+proxy.getMethod()+ VALIDATION_CONFIG_SUFFIX;
        
          return loadFile(fileName, aClass, checkFile);
            }
        

        This now gives us:

        java/lang/Object-validation.xml
        java/lang/Object-eventAdd!save-validation.xml
        com/opensymphony/xwork2/Action-validation.xml
        com/opensymphony/xwork2/Action-eventAdd!save-validation.xml
        com/opensymphony/xwork2/Validateable-validation.xml
        com/opensymphony/xwork2/Validateable-eventAdd!save-validation.xml
        com/opensymphony/xwork2/ValidationAware-validation.xml
        com/opensymphony/xwork2/ValidationAware-eventAdd!save-validation.xml
        com/opensymphony/xwork2/TextProvider-validation.xml
        com/opensymphony/xwork2/TextProvider-eventAdd!save-validation.xml
        com/opensymphony/xwork2/LocaleProvider-validation.xml
        com/opensymphony/xwork2/LocaleProvider-eventAdd!save-validation.xml
        java/io/Serializable-validation.xml
        java/io/Serializable-eventAdd!save-validation.xml
        com/opensymphony/xwork2/ActionSupport-validation.xml
        com/opensymphony/xwork2/ActionSupport-eventAdd!save-validation.xml
        events/ui/struts2/editor/EventBase-validation.xml
        events/ui/struts2/editor/EventBase-eventAdd!save-validation.xml
        events/ui/struts2/editor/EventAdd-validation.xml
        events/ui/struts2/editor/EventAdd-eventAdd!save-validation.xml

        Which works!

        Cheers Greg.

        Show
        ghuber Greg Huber added a comment - - edited In class com.opensymphony.xwork2.validator.AnnotationActionValidatorManager buildAliasValidatorConfigs(..) it never adds the method name. private List<ValidatorConfig> buildAliasValidatorConfigs( Class aClass, String context, boolean checkFile) { String fileName = aClass.getName().replace('.', '/') + "-" + context.replace('/', '-') + VALIDATION_CONFIG_SUFFIX; return loadFile(fileName, aClass, checkFile); } I guess we need another method/modify which handles the bang/method name: private List<ValidatorConfig> buildAliasValidatorConfigs( Class aClass, String context, boolean checkFile) { ActionInvocation invocation = ActionContext.getContext().getActionInvocation(); ActionProxy proxy = invocation.getProxy(); String fileName = aClass.getName().replace('.', '/') + "-" + context.replace('/', '-') + "!" +proxy.getMethod()+ VALIDATION_CONFIG_SUFFIX; return loadFile(fileName, aClass, checkFile); } This now gives us: java/lang/Object-validation.xml java/lang/Object-eventAdd!save-validation.xml com/opensymphony/xwork2/Action-validation.xml com/opensymphony/xwork2/Action-eventAdd!save-validation.xml com/opensymphony/xwork2/Validateable-validation.xml com/opensymphony/xwork2/Validateable-eventAdd!save-validation.xml com/opensymphony/xwork2/ValidationAware-validation.xml com/opensymphony/xwork2/ValidationAware-eventAdd!save-validation.xml com/opensymphony/xwork2/TextProvider-validation.xml com/opensymphony/xwork2/TextProvider-eventAdd!save-validation.xml com/opensymphony/xwork2/LocaleProvider-validation.xml com/opensymphony/xwork2/LocaleProvider-eventAdd!save-validation.xml java/io/Serializable-validation.xml java/io/Serializable-eventAdd!save-validation.xml com/opensymphony/xwork2/ActionSupport-validation.xml com/opensymphony/xwork2/ActionSupport-eventAdd!save-validation.xml events/ui/struts2/editor/EventBase-validation.xml events/ui/struts2/editor/EventBase-eventAdd!save-validation.xml events/ui/struts2/editor/EventAdd-validation.xml events/ui/struts2/editor/EventAdd-eventAdd!save-validation.xml Which works! Cheers Greg.
        Hide
        ghuber Greg Huber added a comment -

        Here is a patch on com.opensymphony.xwork2.validator.AnnotationActionValidatorManager.

        Maven whats that?

        Cheers Greg.

        Show
        ghuber Greg Huber added a comment - Here is a patch on com.opensymphony.xwork2.validator.AnnotationActionValidatorManager. Maven whats that? Cheers Greg.
        Hide
        ghuber Greg Huber added a comment - - edited

        Sorry, forgot DefaultActionValidatorManager also needs the mod.

        See patch_WW-1967_xwork_1.txt

        Show
        ghuber Greg Huber added a comment - - edited Sorry, forgot DefaultActionValidatorManager also needs the mod. See patch_ WW-1967 _xwork_1.txt
        Hide
        ghuber Greg Huber added a comment - - edited

        Sorry, forgot the rest of the world, the method could be empty.

        See patch_WW-1967_xwork_2.txt

        Not sure on DefaultActionValidatorManager, needs checking as the method is passed around as a parameter.

        Cheers Greg

        Show
        ghuber Greg Huber added a comment - - edited Sorry, forgot the rest of the world, the method could be empty. See patch_ WW-1967 _xwork_2.txt Not sure on DefaultActionValidatorManager, needs checking as the method is passed around as a parameter. Cheers Greg
        Hide
        ghuber Greg Huber added a comment - - edited

        Reading the docs, it looks like the action method based validation is no longer supported. Only these are now supported:

        <actionClass>-validation.xml
        <actionClass>-<actionAlias>-validation.xml

        ie ResendPassword-resend-validation.xml instead of ResendPassword-resend!sendRequest-validation.xml

        Looks like they forgot about DMI. So have to use @SkipValidation annotation or mod the class

        Show
        ghuber Greg Huber added a comment - - edited Reading the docs, it looks like the action method based validation is no longer supported. Only these are now supported: <actionClass>-validation.xml <actionClass>-<actionAlias>-validation.xml ie ResendPassword-resend-validation.xml instead of ResendPassword-resend!sendRequest-validation.xml Looks like they forgot about DMI. So have to use @SkipValidation annotation or mod the class
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Are you sure? In my opinion it should work - AnnotationActionValidatorManager#buildValidatorKey should be checked/modified.

        Show
        lukaszlenart Lukasz Lenart added a comment - Are you sure? In my opinion it should work - AnnotationActionValidatorManager#buildValidatorKey should be checked/modified.
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        I found out a simple solution for your problem, without modifying source code. Here is [1] an example app with the solution

        [1] https://github.com/lukaszlenart/struts2-dmi-validation

        I think thus is even better than changing the framework.

        Show
        lukaszlenart Lukasz Lenart added a comment - I found out a simple solution for your problem, without modifying source code. Here is [1] an example app with the solution [1] https://github.com/lukaszlenart/struts2-dmi-validation I think thus is even better than changing the framework.
        Hide
        ghuber Greg Huber added a comment -

        That's great! Would never have worked this one out (worth putting in the docs for dmi users!). Thanks.

        btw I have noticed that struts automatically uses the AnnotationActionValidatorManager by default, in the struts-default.xml there is a name="no-annotations" version, DefaultActionValidatorManager, would it be worth switching to this version, as I do not use annotations.

        struts.xml >> <constant name="struts.actionValidatorManager" value="no-annotations"/>

        Cheers Greg

        Show
        ghuber Greg Huber added a comment - That's great! Would never have worked this one out (worth putting in the docs for dmi users!). Thanks. btw I have noticed that struts automatically uses the AnnotationActionValidatorManager by default, in the struts-default.xml there is a name="no-annotations" version, DefaultActionValidatorManager, would it be worth switching to this version, as I do not use annotations. struts.xml >> <constant name="struts.actionValidatorManager" value="no-annotations"/> Cheers Greg
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Basically, creating your own stack(s) with just the interceptors you're using in your app is the best practise

        http://struts.apache.org/2.x/docs/performance-tuning.html

        Can I close this issue?

        Show
        lukaszlenart Lukasz Lenart added a comment - Basically, creating your own stack(s) with just the interceptors you're using in your app is the best practise http://struts.apache.org/2.x/docs/performance-tuning.html Can I close this issue?
        Hide
        ghuber Greg Huber added a comment -

        Yes. Thanks again.

        Show
        ghuber Greg Huber added a comment - Yes. Thanks again.
        Hide
        ghuber Greg Huber added a comment -

        For anyone else looking at this, resolved with Lukasz solution above, interceptor:

        /**
         * Define our own context to support method's names in validation file name If
         * DMI is enabled and method was specified validation file name will be
         * constructed like this: -
         * 
         * <ActionClass>-<actionAlias>!<methodName>-validation.xml
         */
        public class DMIAwareValidationInterceptor extends ValidationInterceptor {
        
        	private static final long serialVersionUID = 9007212648956424490L;
        	private boolean dmiEnabled = false;
        
        	@Inject(StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION)
        	public void setEnableDynamicMethodInvocation(String value) {
        		dmiEnabled = Boolean.parseBoolean(value);
        	}
        
        	/**
        	 * @see com.opensymphony.xwork2.validator.ValidationInterceptor#getValidationContext(com.opensymphony.xwork2.ActionProxy)
        	 */
        	@Override
        	protected String getValidationContext(ActionProxy proxy) {
        		if (dmiEnabled && StringUtils.isNotEmpty(proxy.getMethod())) {
        			return proxy.getActionName() + "!" + proxy.getMethod();
        		}
        		return super.getValidationContext(proxy);
        	}
        
        }
        
        Show
        ghuber Greg Huber added a comment - For anyone else looking at this, resolved with Lukasz solution above, interceptor: /** * Define our own context to support method's names in validation file name If * DMI is enabled and method was specified validation file name will be * constructed like this : - * * <ActionClass>-<actionAlias>!<methodName>-validation.xml */ public class DMIAwareValidationInterceptor extends ValidationInterceptor { private static final long serialVersionUID = 9007212648956424490L; private boolean dmiEnabled = false ; @Inject(StrutsConstants.STRUTS_ENABLE_DYNAMIC_METHOD_INVOCATION) public void setEnableDynamicMethodInvocation( String value) { dmiEnabled = Boolean .parseBoolean(value); } /** * @see com.opensymphony.xwork2.validator.ValidationInterceptor#getValidationContext(com.opensymphony.xwork2.ActionProxy) */ @Override protected String getValidationContext(ActionProxy proxy) { if (dmiEnabled && StringUtils.isNotEmpty(proxy.getMethod())) { return proxy.getActionName() + "!" + proxy.getMethod(); } return super .getValidationContext(proxy); } }

          People

          • Assignee:
            lukaszlenart Lukasz Lenart
            Reporter:
            ghuber Greg Huber
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development