struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Łukasz Lenart <lukasz.len...@googlemail.com>
Subject Re: svn commit: r1228497 - /struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java
Date Sun, 08 Jan 2012 12:02:57 GMT
Oh... right :-)

2012/1/7 John Lindal <support_0384@newplanetsoftware.com>:
> No, because convertParam expands the wildcard expression :)
>
> John
>
> On Jan 7, 2012, at 11:58 AM, Łukasz Lenart wrote:
>
>> Wouldn't be better to first check if it's an allowed-method and then
>> call convertParam() method ?
>>
>> if (!orig.isAllowedMethod(methodName)) {
>>    return null;
>> }
>> String methodName = convertParam(orig.getMethodName(), vars);
>>
>>
>> Regards
>> -- Łukasz
>> + 48 606 323 122 http://www.lenart.org.pl/
>> Warszawa JUG conference - Confitura http://confitura.pl/
>>
>> 2012/1/7  <jafl@apache.org>:
>>>
>>> Author: jafl
>>> Date: Fri Jan  6 23:19:32 2012
>>> New Revision: 1228497
>>>
>>> URL: http://svn.apache.org/viewvc?rev=1228497&view=rev
>>> Log:
>>> WW-3740 apply allowed-methods filter to wildcard actions
>>>
>>> Modified:
>>>
>>> struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java
>>>
>>> Modified:
>>> struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java
>>> URL:
>>> http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java?rev=1228497&r1=1228496&r2=1228497&view=diff
>>>
>>> ==============================================================================
>>> ---
>>> struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java
>>> (original)
>>> +++
>>> struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/config/impl/ActionConfigMatcher.java
>>> Fri Jan  6 23:19:32 2012
>>> @@ -109,13 +109,17 @@ public class ActionConfigMatcher extends
>>>     */
>>>    @Override public ActionConfig convert(String path, ActionConfig orig,
>>>        Map<String, String> vars) {
>>> -
>>> -        String className = convertParam(orig.getClassName(), vars);
>>> +
>>>        String methodName = convertParam(orig.getMethodName(), vars);
>>> +        if (!orig.isAllowedMethod(methodName)) {
>>> +            return null;
>>> +        }
>>> +
>>> +        String className = convertParam(orig.getClassName(), vars);
>>>        String pkgName = convertParam(orig.getPackageName(), vars);
>>> -
>>> +
>>>        Map<String,String> params = replaceParameters(orig.getParams(),
>>> vars);
>>> -
>>> +
>>>        Map<String,ResultConfig> results = new
>>> LinkedHashMap<String,ResultConfig>();
>>>        for (String name : orig.getResults().keySet()) {
>>>            ResultConfig result = orig.getResults().get(name);
>>> @@ -125,7 +129,7 @@ public class ActionConfigMatcher extends
>>>                    .build();
>>>            results.put(name, r);
>>>        }
>>> -
>>> +
>>>        List<ExceptionMappingConfig> exs = new
>>> ArrayList<ExceptionMappingConfig>();
>>>        for (ExceptionMappingConfig ex : orig.getExceptionMappings()) {
>>>            String name = convertParam(ex.getName(), vars);
>>> @@ -135,7 +139,7 @@ public class ActionConfigMatcher extends
>>>            ExceptionMappingConfig e = new
>>> ExceptionMappingConfig.Builder(name, exClassName,
>>> exResult).addParams(exParams).build();
>>>            exs.add(e);
>>>        }
>>> -
>>> +
>>>        return new ActionConfig.Builder(pkgName, orig.getName(),
>>> className)
>>>                .methodName(methodName)
>>>                .addParams(params)
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
>> For additional commands, e-mail: dev-help@struts.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
> For additional commands, e-mail: dev-help@struts.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Mime
View raw message