[jira] [Updated] (WW-4494) Improve FreemarkerManager to activate new freemarker feature

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart updated WW-4494:
--
Fix Version/s: (was: 2.3.24)
   2.5

> Improve FreemarkerManager to activate new freemarker feature
> 
>
> Key: WW-4494
> URL: https://issues.apache.org/jira/browse/WW-4494
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: zhouyanming
> Fix For: 2.5
>
>
> http://freemarker.org/docs/pgui_config_incompatible_improvements.html#pgui_config_incompatible_improvements_how_to_set
> use "new Configuration(Configuration.VERSION_2_3_22)" instead of "new 
> Configuration( )"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4494) Improve FreemarkerManager to activate new freemarker feature

2015-04-29 Thread Lukasz Lenart (JIRA)

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

Lukasz Lenart commented on WW-4494:
---

I'm going postpone this as it breaks backward compatibility - at least few 
tests are exploding which means we can introduce odd behaviour into users' 
applications. Anyway I'm adding a note how to enable new features via 
{{freemarker.properties}} - any comments are welcome :)

https://cwiki.apache.org/confluence/display/WW/FreeMarker#FreeMarker-IncompatibleImprovements

> Improve FreemarkerManager to activate new freemarker feature
> 
>
> Key: WW-4494
> URL: https://issues.apache.org/jira/browse/WW-4494
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: zhouyanming
> Fix For: 2.3.24
>
>
> http://freemarker.org/docs/pgui_config_incompatible_improvements.html#pgui_config_incompatible_improvements_how_to_set
> use "new Configuration(Configuration.VERSION_2_3_22)" instead of "new 
> Configuration( )"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4494) Improve FreemarkerManager to activate new freemarker feature

2015-04-29 Thread Lukasz Lenart (JIRA)

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

Lukasz Lenart commented on WW-4494:
---

As far I understand you can always revert to the old version with defining a 
key in {{freemarker.properties}}
{noformat}
incompatible_improvements=2.3.0
{noformat}

> Improve FreemarkerManager to activate new freemarker feature
> 
>
> Key: WW-4494
> URL: https://issues.apache.org/jira/browse/WW-4494
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: zhouyanming
> Fix For: 2.3.24
>
>
> http://freemarker.org/docs/pgui_config_incompatible_improvements.html#pgui_config_incompatible_improvements_how_to_set
> use "new Configuration(Configuration.VERSION_2_3_22)" instead of "new 
> Configuration( )"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4493) Still can't pass parameters with dashes to tags

2015-04-29 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on WW-4493:
-

Commit 791364cf6d97528ec75b8859450204150d55ed5e in struts's branch 
refs/heads/develop from [~lukaszlenart]
[ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=791364c ]

WW-4493 Allows to pass parameters witch dashes in names


> Still can't pass parameters with dashes to tags
> ---
>
> Key: WW-4493
> URL: https://issues.apache.org/jira/browse/WW-4493
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Affects Versions: 2.3.20
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: freemarker, tags
> Fix For: 2.3.24
>
>
> The latest freemarker now supports dashes in attribute names, so I can write 
> something like:
> {code:xml}
> <@s.form name="sendToPhone" data\-ajax="false">
> 
> {code}
> Unfortunately, the parameters are set using ognl internally, so it blows up 
> with an error like: 
> {noformat}
> Caused by: ognl.InappropriateExpressionException: Inappropriate OGNL 
> expression: data - ajax
> at ognl.SimpleNode.setValueBody(SimpleNode.java:312)
> at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
> at ognl.SimpleNode.setValue(SimpleNode.java:301)
> at ognl.Ognl.setValue(Ognl.java:737)
> at com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:287)
> at com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:282)
> at 
> com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:340)
> at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:282)
> {noformat}
> I think there is a simple solution, which is to send any parameters with an 
> dash directly to the parameters map like so:
> {code:title=Component.java|borderStyle=solid}
> /**
>  * Pushes this component's parameter Map as well as the component itself 
> on to the stack
>  * and then copies the supplied parameters over. Because the component's 
> parameter Map is
>  * pushed before the component itself, any key-value pair that can't be 
> assigned to component
>  * will be set in the parameters Map.
>  *
>  * @param params  the parameters to copy.
>  */
> public void copyParams(Map params) {
> stack.push(parameters);
> stack.push(this);
> try {
> for (Object o : params.entrySet()) {
> Map.Entry entry = (Map.Entry) o;
> String key = (String) entry.getKey();
> 
> if (key.indexOf('-') >= 0) {
> // UI component attributes may contain hypens (e.g. 
> data-ajax), but ognl
> // can't handle that, and there can't be a component 
> property with a hypen
> // so into the parameters map it goes.
> parameters.put(key, entry.getValue());
> } else {
> stack.setValue(key, entry.getValue());
> }
> }
> } finally {
> stack.pop();
> stack.pop();
> }
> }
> {code}
> Hoping this can make it into 2.3.24, thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (WW-4493) Still can't pass parameters with dashes to tags

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart resolved WW-4493.
---
Resolution: Fixed
  Assignee: Lukasz Lenart

Patch applied, thanks!

> Still can't pass parameters with dashes to tags
> ---
>
> Key: WW-4493
> URL: https://issues.apache.org/jira/browse/WW-4493
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Affects Versions: 2.3.20
>Reporter: Jasper Rosenberg
>Assignee: Lukasz Lenart
>Priority: Minor
>  Labels: freemarker, tags
> Fix For: 2.3.24
>
>
> The latest freemarker now supports dashes in attribute names, so I can write 
> something like:
> {code:xml}
> <@s.form name="sendToPhone" data\-ajax="false">
> 
> {code}
> Unfortunately, the parameters are set using ognl internally, so it blows up 
> with an error like: 
> {noformat}
> Caused by: ognl.InappropriateExpressionException: Inappropriate OGNL 
> expression: data - ajax
> at ognl.SimpleNode.setValueBody(SimpleNode.java:312)
> at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
> at ognl.SimpleNode.setValue(SimpleNode.java:301)
> at ognl.Ognl.setValue(Ognl.java:737)
> at com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:287)
> at com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:282)
> at 
> com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:340)
> at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:282)
> {noformat}
> I think there is a simple solution, which is to send any parameters with an 
> dash directly to the parameters map like so:
> {code:title=Component.java|borderStyle=solid}
> /**
>  * Pushes this component's parameter Map as well as the component itself 
> on to the stack
>  * and then copies the supplied parameters over. Because the component's 
> parameter Map is
>  * pushed before the component itself, any key-value pair that can't be 
> assigned to component
>  * will be set in the parameters Map.
>  *
>  * @param params  the parameters to copy.
>  */
> public void copyParams(Map params) {
> stack.push(parameters);
> stack.push(this);
> try {
> for (Object o : params.entrySet()) {
> Map.Entry entry = (Map.Entry) o;
> String key = (String) entry.getKey();
> 
> if (key.indexOf('-') >= 0) {
> // UI component attributes may contain hypens (e.g. 
> data-ajax), but ognl
> // can't handle that, and there can't be a component 
> property with a hypen
> // so into the parameters map it goes.
> parameters.put(key, entry.getValue());
> } else {
> stack.setValue(key, entry.getValue());
> }
> }
> } finally {
> stack.pop();
> stack.pop();
> }
> }
> {code}
> Hoping this can make it into 2.3.24, thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4496) better reconciliation of static url mappings

2015-04-29 Thread Lukasz Lenart (JIRA)

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

Lukasz Lenart commented on WW-4496:
---

This won't happen in 2.3 as it breaks backward compatibility

> better reconciliation of static url mappings
> 
>
> Key: WW-4496
> URL: https://issues.apache.org/jira/browse/WW-4496
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: adam brin
> Fix For: 2.5
>
>
> the struts static url mappings are great for simplifying URL paths and 
> including "data" in the URL structures.  We're having collisions that are 
> causing problems though:
> eg.
> {quote}
> class1:
> @Namespace("/dataset/")
> ...
> @Action("\{id\}")
> ...
> class3:
> @Namespace("/dataset")
> ...
> @Action("columns/\{id\}")
> {quote}
> In this case, Class1's mapping seem to "own" everything under /dataset 
> regardless of what other classes like (class2) define.  It'd be nice if 
> struts could, as it scans all of the namespaces and actions, evaluated 
> left-to-right non-programatically specified values ahead of those that are 
> variables. E.g. /dataset/columns/\{id\} would be evaluated prior to matching 
> /dataset/\{id\}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4496) better reconciliation of static url mappings

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart updated WW-4496:
--
Fix Version/s: 2.5

> better reconciliation of static url mappings
> 
>
> Key: WW-4496
> URL: https://issues.apache.org/jira/browse/WW-4496
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: adam brin
> Fix For: 2.5
>
>
> the struts static url mappings are great for simplifying URL paths and 
> including "data" in the URL structures.  We're having collisions that are 
> causing problems though:
> eg.
> {quote}
> class1:
> @Namespace("/dataset/")
> ...
> @Action("\{id\}")
> ...
> class3:
> @Namespace("/dataset")
> ...
> @Action("columns/\{id\}")
> {quote}
> In this case, Class1's mapping seem to "own" everything under /dataset 
> regardless of what other classes like (class2) define.  It'd be nice if 
> struts could, as it scans all of the namespaces and actions, evaluated 
> left-to-right non-programatically specified values ahead of those that are 
> variables. E.g. /dataset/columns/\{id\} would be evaluated prior to matching 
> /dataset/\{id\}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4496) better reconciliation of static url mappings

2015-04-29 Thread adam brin (JIRA)

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

adam brin commented on WW-4496:
---

an extension to this that we also encounter is:

bq. @Action("\{id\}/\{slug\}")

vs.

bq. @Action("\{id\}/edit")

again, it'd be useful if the defined paths trump the programmatic ones.

> better reconciliation of static url mappings
> 
>
> Key: WW-4496
> URL: https://issues.apache.org/jira/browse/WW-4496
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: adam brin
>
> the struts static url mappings are great for simplifying URL paths and 
> including "data" in the URL structures.  We're having collisions that are 
> causing problems though:
> eg.
> {quote}
> class1:
> @Namespace("/dataset/")
> ...
> @Action("\{id\}")
> ...
> class3:
> @Namespace("/dataset")
> ...
> @Action("columns/\{id\}")
> {quote}
> In this case, Class1's mapping seem to "own" everything under /dataset 
> regardless of what other classes like (class2) define.  It'd be nice if 
> struts could, as it scans all of the namespaces and actions, evaluated 
> left-to-right non-programatically specified values ahead of those that are 
> variables. E.g. /dataset/columns/\{id\} would be evaluated prior to matching 
> /dataset/\{id\}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4496) better reconciliation of static url mappings

2015-04-29 Thread adam brin (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

adam brin updated WW-4496:
--
Description: 
the struts static url mappings are great for simplifying URL paths and 
including "data" in the URL structures.  We're having collisions that are 
causing problems though:

eg.
{quote}
class1:
@Namespace("/dataset/")
...
@Action("\{id\}")

...
class3:
@Namespace("/dataset")
...
@Action("columns/\{id\}")
{quote}

In this case, Class1's mapping seem to "own" everything under /dataset 
regardless of what other classes like (class2) define.  It'd be nice if struts 
could, as it scans all of the namespaces and actions, evaluated left-to-right 
non-programatically specified values ahead of those that are variables. E.g. 
/dataset/columns/\{id\} would be evaluated prior to matching /dataset/\{id\}

  was:
the struts static url mappings are great for simplifying URL paths and 
including "data" in the URL structures.  We're having collisions that are 
causing problems though:

eg.
{quote}
class1:
@Namespace("/dataset/")
...
@Action("\{id\}")

...
class3:
@Namespace("/dataset")
...
@Action("columns/\{id\}")
{quote}

In this case, Class1's mapping seem to "own" everything under /dataset 
regardless of what other classes like (class2) define.  It'd be nice if struts 
could, as it scans all of the namespaces and actions, evaluated left-to-right 
non-programatically specified values ahead of those that are variables. E.g. 
/dataset/columns/{id} would be evaluated prior to matching /dataset/{id}


> better reconciliation of static url mappings
> 
>
> Key: WW-4496
> URL: https://issues.apache.org/jira/browse/WW-4496
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: adam brin
>
> the struts static url mappings are great for simplifying URL paths and 
> including "data" in the URL structures.  We're having collisions that are 
> causing problems though:
> eg.
> {quote}
> class1:
> @Namespace("/dataset/")
> ...
> @Action("\{id\}")
> ...
> class3:
> @Namespace("/dataset")
> ...
> @Action("columns/\{id\}")
> {quote}
> In this case, Class1's mapping seem to "own" everything under /dataset 
> regardless of what other classes like (class2) define.  It'd be nice if 
> struts could, as it scans all of the namespaces and actions, evaluated 
> left-to-right non-programatically specified values ahead of those that are 
> variables. E.g. /dataset/columns/\{id\} would be evaluated prior to matching 
> /dataset/\{id\}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4496) better reconciliation of static url mappings

2015-04-29 Thread adam brin (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

adam brin updated WW-4496:
--
Description: 
the struts static url mappings are great for simplifying URL paths and 
including "data" in the URL structures.  We're having collisions that are 
causing problems though:

eg.
{quote}
class1:
@Namespace("/dataset/")
...
@Action("\X{id}")

...
class3:
@Namespace("/dataset")
...
@Action("columns/\X{id}")
{quote}

In this case, Class1's mapping seem to "own" everything under /dataset 
regardless of what other classes like (class2) define.  It'd be nice if struts 
could, as it scans all of the namespaces and actions, evaluated left-to-right 
non-programatically specified values ahead of those that are variables. E.g. 
/dataset/columns/{id} would be evaluated prior to matching /dataset/{id}

  was:
the struts static url mappings are great for simplifying URL paths and 
including "data" in the URL structures.  We're having collisions that are 
causing problems though:

eg.
{quote}
class1:
@Namespace("/dataset/")
...
@Action("{id}")

...
class3:
@Namespace("/dataset")
...
@Action("columns/{id}")
{quote}

In this case, Class1's mapping seem to "own" everything under /dataset 
regardless of what other classes like (class2) define.  It'd be nice if struts 
could, as it scans all of the namespaces and actions, evaluated left-to-right 
non-programatically specified values ahead of those that are variables. E.g. 
/dataset/columns/{id} would be evaluated prior to matching /dataset/{id}


> better reconciliation of static url mappings
> 
>
> Key: WW-4496
> URL: https://issues.apache.org/jira/browse/WW-4496
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: adam brin
>
> the struts static url mappings are great for simplifying URL paths and 
> including "data" in the URL structures.  We're having collisions that are 
> causing problems though:
> eg.
> {quote}
> class1:
> @Namespace("/dataset/")
> ...
> @Action("\X{id}")
> ...
> class3:
> @Namespace("/dataset")
> ...
> @Action("columns/\X{id}")
> {quote}
> In this case, Class1's mapping seem to "own" everything under /dataset 
> regardless of what other classes like (class2) define.  It'd be nice if 
> struts could, as it scans all of the namespaces and actions, evaluated 
> left-to-right non-programatically specified values ahead of those that are 
> variables. E.g. /dataset/columns/{id} would be evaluated prior to matching 
> /dataset/{id}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4496) better reconciliation of static url mappings

2015-04-29 Thread adam brin (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

adam brin updated WW-4496:
--
Description: 
the struts static url mappings are great for simplifying URL paths and 
including "data" in the URL structures.  We're having collisions that are 
causing problems though:

eg.
{quote}
class1:
@Namespace("/dataset/")
...
@Action("\{id\}")

...
class3:
@Namespace("/dataset")
...
@Action("columns/\{id\}")
{quote}

In this case, Class1's mapping seem to "own" everything under /dataset 
regardless of what other classes like (class2) define.  It'd be nice if struts 
could, as it scans all of the namespaces and actions, evaluated left-to-right 
non-programatically specified values ahead of those that are variables. E.g. 
/dataset/columns/{id} would be evaluated prior to matching /dataset/{id}

  was:
the struts static url mappings are great for simplifying URL paths and 
including "data" in the URL structures.  We're having collisions that are 
causing problems though:

eg.
{quote}
class1:
@Namespace("/dataset/")
...
@Action("\X{id}")

...
class3:
@Namespace("/dataset")
...
@Action("columns/\X{id}")
{quote}

In this case, Class1's mapping seem to "own" everything under /dataset 
regardless of what other classes like (class2) define.  It'd be nice if struts 
could, as it scans all of the namespaces and actions, evaluated left-to-right 
non-programatically specified values ahead of those that are variables. E.g. 
/dataset/columns/{id} would be evaluated prior to matching /dataset/{id}


> better reconciliation of static url mappings
> 
>
> Key: WW-4496
> URL: https://issues.apache.org/jira/browse/WW-4496
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: adam brin
>
> the struts static url mappings are great for simplifying URL paths and 
> including "data" in the URL structures.  We're having collisions that are 
> causing problems though:
> eg.
> {quote}
> class1:
> @Namespace("/dataset/")
> ...
> @Action("\{id\}")
> ...
> class3:
> @Namespace("/dataset")
> ...
> @Action("columns/\{id\}")
> {quote}
> In this case, Class1's mapping seem to "own" everything under /dataset 
> regardless of what other classes like (class2) define.  It'd be nice if 
> struts could, as it scans all of the namespaces and actions, evaluated 
> left-to-right non-programatically specified values ahead of those that are 
> variables. E.g. /dataset/columns/{id} would be evaluated prior to matching 
> /dataset/{id}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4496) better reconciliation of static url mappings

2015-04-29 Thread adam brin (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

adam brin updated WW-4496:
--
Description: 
the struts static url mappings are great for simplifying URL paths and 
including "data" in the URL structures.  We're having collisions that are 
causing problems though:

eg.
{quote}
class1:
@Namespace("/dataset/")
...
@Action("{id}")

...
class3:
@Namespace("/dataset")
...
@Action("columns/{id}")
{quote}

In this case, Class1's mapping seem to "own" everything under /dataset 
regardless of what other classes like (class2) define.  It'd be nice if struts 
could, as it scans all of the namespaces and actions, evaluated left-to-right 
non-programatically specified values ahead of those that are variables. E.g. 
/dataset/columns/{id} would be evaluated prior to matching /dataset/{id}

  was:
the struts static url mappings are great for simplifying URL paths and 
including "data" in the URL structures.  We're having collisions that are 
causing problems though:

eg.
{quote}
class1:
@Namespace("/dataset/")
...
@Action("{id}")

...

class2:
@Namespace("/dataset/columns")
...
@Action("{id}")

class3:
@Namespace("/dataset")
...
@Action("columns/{id}")
{quote}

In this case, Class1's mapping seem to "own" everything under /dataset 
regardless of what other classes define.  It'd be nice if struts could, as it 
scans all of the namespaces and actions, evaluated left-to-right 
non-programatically specified values ahead of those that are variables. E.g. 
/dataset/columns/{id} would be evaluated prior to matching /dataset/{id}


> better reconciliation of static url mappings
> 
>
> Key: WW-4496
> URL: https://issues.apache.org/jira/browse/WW-4496
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: adam brin
>
> the struts static url mappings are great for simplifying URL paths and 
> including "data" in the URL structures.  We're having collisions that are 
> causing problems though:
> eg.
> {quote}
> class1:
> @Namespace("/dataset/")
> ...
> @Action("{id}")
> ...
> class3:
> @Namespace("/dataset")
> ...
> @Action("columns/{id}")
> {quote}
> In this case, Class1's mapping seem to "own" everything under /dataset 
> regardless of what other classes like (class2) define.  It'd be nice if 
> struts could, as it scans all of the namespaces and actions, evaluated 
> left-to-right non-programatically specified values ahead of those that are 
> variables. E.g. /dataset/columns/{id} would be evaluated prior to matching 
> /dataset/{id}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Created] (WW-4496) better reconciliation of static url mappings

2015-04-29 Thread adam brin (JIRA)
adam brin created WW-4496:
-

 Summary: better reconciliation of static url mappings
 Key: WW-4496
 URL: https://issues.apache.org/jira/browse/WW-4496
 Project: Struts 2
  Issue Type: Improvement
Affects Versions: 2.3.20
Reporter: adam brin


the struts static url mappings are great for simplifying URL paths and 
including "data" in the URL structures.  We're having collisions that are 
causing problems though:

eg.
{quote}
class1:
@Namespace("/dataset/")
...
@Action("{id}")

...

class2:
@Namespace("/dataset/columns")
...
@Action("{id}")

class3:
@Namespace("/dataset")
...
@Action("columns/{id}")
{quote}

In this case, Class1's mapping seem to "own" everything under /dataset 
regardless of what other classes define.  It'd be nice if struts could, as it 
scans all of the namespaces and actions, evaluated left-to-right 
non-programatically specified values ahead of those that are variables. E.g. 
/dataset/columns/{id} would be evaluated prior to matching /dataset/{id}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (WW-4486) Default parameter exclusions blocking legitimate values

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4486?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart resolved WW-4486.
---
Resolution: Fixed
  Assignee: Lukasz Lenart

"class" pattern was dropped as access to "java.lang.Class" is blocked 
internally by OGNL

> Default parameter exclusions blocking legitimate values
> ---
>
> Key: WW-4486
> URL: https://issues.apache.org/jira/browse/WW-4486
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Interceptors
>Affects Versions: 2.3.20
>Reporter: Jasper Rosenberg
>Assignee: Lukasz Lenart
>Priority: Critical
> Fix For: 2.3.24
>
>
> In ParametersInterceptor.setParameters(), when building 
> acceptableParameters(), it applies the check isAcceptableValue not just just 
> to the parameter name, but also to the parameter value.  This is a huge 
> problem because the default excludedPatterns include phrases that will come 
> up in normal user form submissions.  
> For example, the way I discovered this is that one pattern is 
> "(.*\.|^|.*|\[('|"))\bclass(\.|('|")]|\[).*"
> We are a car site, so when a user tried to post a message about a Mercedes M 
> class: "That's M class. You asked for G class, different beast!"
> The "class." at the end of the first sentence was rejected and so their post 
> failed.
> What is the reason for applying the exclusion patterns wholesale to the 
> parameter value?  Is it even necessary at all, or is there some kind of 
> escape character that normally tells ognl to evaluate an expression in the 
> value, in which case we could check for exclusion pattern matches just within 
> those?
> As it is though, the current solution is going to cause some occasional very 
> peculiar behavior for developers.  Not sure if this should actually be a 
> blocker bug since the only reasonable workaround seems to be to hack the 
> ParametersInterceptor locally (since one shouldn't remove the exclusion 
> patterns in general).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (WW-4490) Could not create JarEntryRevision - Struts app migrated from Tomcat 6 to Tomcat 8

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4490?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart resolved WW-4490.
---
Resolution: Cannot Reproduce

> Could not create JarEntryRevision - Struts app migrated from Tomcat 6 to 
> Tomcat 8
> -
>
> Key: WW-4490
> URL: https://issues.apache.org/jira/browse/WW-4490
> Project: Struts 2
>  Issue Type: Bug
>  Components: Dispatch Filter
>Affects Versions: 2.3.16
> Environment: Tomcat 8.0.18
>Reporter: Andrew Carr
> Fix For: 2.3.24
>
>
> It looks like deploying an application on Tomcat 8.0.18 using Struts 2.3.16 
> generates a warning:
> com.opensymphony.xwork2.util.fs.JarEntryRevision [localhost-startStop-1] ,  - 
> Could not create JarEntryRevision for 
> [jar:war:file:/apps/tg/test/webapps/gateway-pilot-admin.war^/WEB-INF/lib/struts2-core-2.3.16.jar]!
> I am in the process of additional testing, any thoughts are welcome.
> Full Stack Trace below
> {noformat}
> 2015-04-06 17:12:13,165 WARN  
> com.opensymphony.xwork2.util.fs.JarEntryRevision [localhost-startStop-1] ,  - 
> Could not create JarEntryRevision for 
> [jar:war:file:/apps/tg/test/webapps/gateway-pilot-admin.war^/WEB-INF/lib/struts2-core-2.3.16.jar]!
> java.io.FileNotFoundException: 
> war:file:/apps/tg/test/webapps/gateway-pilot-admin.war^/WEB-INF/lib/struts2-core-2.3.16.jar
>  (No such file or directory)
> at java.util.zip.ZipFile.open(Native Method)
> at java.util.zip.ZipFile.(ZipFile.java:220)
> at java.util.zip.ZipFile.(ZipFile.java:150)
> at java.util.jar.JarFile.(JarFile.java:166)
> at java.util.jar.JarFile.(JarFile.java:130)
> at 
> com.opensymphony.xwork2.util.fs.JarEntryRevision.build(JarEntryRevision.java:50)
> at 
> com.opensymphony.xwork2.util.fs.DefaultFileManager.monitorFile(DefaultFileManager.java:97)
> at 
> com.opensymphony.xwork2.util.fs.DefaultFileManager.loadFile(DefaultFileManager.java:74)
> at 
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:1011)
> at 
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:165)
> at 
> com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:132)
> at 
> com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:233)
> at 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
> at 
> org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445)
> at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:489)
> at 
> org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
> at 
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
> at 
> org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
> at 
> org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
> at 
> org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:105)
> at 
> org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4565)
> at 
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5180)
> at 
> org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725)
> at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701)
> at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
> at 
> org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:917)
> at 
> org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1701)
> at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> at java.lang.Thread.run(Thread.java:745)
>  {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (WW-4489) Simplify DefaultExcludedPatternsChecker class pattern

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart resolved WW-4489.
---
Resolution: Fixed
  Assignee: Lukasz Lenart

Pattern adjusted

> Simplify DefaultExcludedPatternsChecker class pattern
> -
>
> Key: WW-4489
> URL: https://issues.apache.org/jira/browse/WW-4489
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Interceptors
>Affects Versions: 2.3.20
>Reporter: Jasper Rosenberg
>Assignee: Lukasz Lenart
>Priority: Minor
> Fix For: 2.3.24
>
>
> The current pattern that matches class expressions looks like:
> {code:java}"(.*\\.|^|.*|\\[('|\"))\\bclass(\\.|('|\")]|\\[).*"{code}
> However, as far as I can tell, this is completely equivalent to:
> {code:java}".*\\bclass(\\.|('|\")]|\\[).*"{code}
> Not sure if this is a bug, or an improvement.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (WW-4488) Improve performance of DefaultExcludedPatternsChecker

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart resolved WW-4488.
---
Resolution: Fixed
  Assignee: Lukasz Lenart

Pattern simplified

> Improve performance of DefaultExcludedPatternsChecker
> -
>
> Key: WW-4488
> URL: https://issues.apache.org/jira/browse/WW-4488
> Project: Struts 2
>  Issue Type: Improvement
>  Components: Core Interceptors
>Affects Versions: 2.3.20
>Reporter: Jasper Rosenberg
>Assignee: Lukasz Lenart
>Priority: Trivial
> Fix For: 2.3.24
>
>
> The current set of patterns can be consolidated without sacrificing 
> readability for a significant gain in efficiency.  I ran both sets of 
> equivalent patterns against the three test methods in 
> DefaultExcludedPatternsCheckerTest 100,000 times, and the consolidated 
> pattern was 3 times faster.
> {code:java}
> public static final String[] EXCLUDED_PATTERNS = {
> "(.*\\.|^|.*|\\[('|\"))\\bclass(\\.|('|\")]|\\[).*",
> 
> "(^|.*#)(dojo|struts|session|request|application|servlet(Request|Response)"
>  + "|parameters|context|_memberAccess)(\\.|\\[).*"
> };
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4491) CLONE - Struts 2.3.8 threads BLOCKED in com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(WW3971)

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart updated WW-4491:
--
Fix Version/s: (was: 2.3.24)
   2.3.20

> CLONE - Struts 2.3.8 threads BLOCKED in 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(WW3971)
> 
>
> Key: WW-4491
> URL: https://issues.apache.org/jira/browse/WW-4491
> Project: Struts 2
>  Issue Type: Bug
>  Components: XML Configuration
>Affects Versions: 2.3.12
> Environment: ava(TM) SE Runtime Environment (build 1.6.0_71-b12)
> Weblogic 10.3.6
> SLES
> JARS:
> struts2-core-2.3.12.jar
> struts2-spring-plugin-2.3.12.jar
>Reporter: Wilson Rao
>Assignee: Lukasz Lenart
> Fix For: 2.3.20
>
> Attachments: LockedOn.png, ThreadDump.png
>
>
> This is a clone of Issue:
> CLONE - Struts 2.3.8 threads BLOCKED in 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(WW3971)
> We followed the instructions in the original ticket and installed version  
> 2.3.12, however we still see the same problem there. Under load we see 
> several threads hung on getConfiguration. The only alternative is to restart 
> the app. 
> "[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default 
> (self-tuning)'" daemon prio=10 tid=0x7f70b55f4800 nid=0x1aa waiting for 
> monitor entry [0x7f70b3916000]
>   java.lang.Thread.State: BLOCKED (on object monitor)
>at 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:64)
>- waiting to lock <0x00051b3214f0> (a 
> com.opensymphony.xwork2.config.ConfigurationManager)
>at 
> org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:942)
> Can we you please investigate this?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Closed] (WW-4491) CLONE - Struts 2.3.8 threads BLOCKED in com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(WW3971)

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart closed WW-4491.
-
Resolution: Not A Problem

> CLONE - Struts 2.3.8 threads BLOCKED in 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(WW3971)
> 
>
> Key: WW-4491
> URL: https://issues.apache.org/jira/browse/WW-4491
> Project: Struts 2
>  Issue Type: Bug
>  Components: XML Configuration
>Affects Versions: 2.3.12
> Environment: ava(TM) SE Runtime Environment (build 1.6.0_71-b12)
> Weblogic 10.3.6
> SLES
> JARS:
> struts2-core-2.3.12.jar
> struts2-spring-plugin-2.3.12.jar
>Reporter: Wilson Rao
>Assignee: Lukasz Lenart
> Fix For: 2.3.20
>
> Attachments: LockedOn.png, ThreadDump.png
>
>
> This is a clone of Issue:
> CLONE - Struts 2.3.8 threads BLOCKED in 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(WW3971)
> We followed the instructions in the original ticket and installed version  
> 2.3.12, however we still see the same problem there. Under load we see 
> several threads hung on getConfiguration. The only alternative is to restart 
> the app. 
> "[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default 
> (self-tuning)'" daemon prio=10 tid=0x7f70b55f4800 nid=0x1aa waiting for 
> monitor entry [0x7f70b3916000]
>   java.lang.Thread.State: BLOCKED (on object monitor)
>at 
> com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:64)
>- waiting to lock <0x00051b3214f0> (a 
> com.opensymphony.xwork2.config.ConfigurationManager)
>at 
> org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:942)
> Can we you please investigate this?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4481) Deprecated warning gives no context

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart updated WW-4481:
--
Affects Version/s: (was: 2.3.23)
   2.3.20

> Deprecated warning gives no context
> ---
>
> Key: WW-4481
> URL: https://issues.apache.org/jira/browse/WW-4481
> Project: Struts 2
>  Issue Type: Bug
>  Components: Value Stack
>Affects Versions: 2.3.20
>Reporter: Jasper Rosenberg
>Assignee: Lukasz Lenart
>Priority: Critical
> Fix For: 2.3.24
>
>
> I released 2.3.22 and immediately had my log files fill up with this warning:
> WARN  [SecurityMemberAccess] Support for accessing static methods is 
> deprecated! Please refactor your application!
> I was surprised because I thought I had actually removed all static 
> references, but I can't find what I missed because this warning has no 
> context.  Can you please add the information about the expression being 
> evaluated so I can track down the usage?  Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4494) Improve FreemarkerManager to activate new freemarker feature

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4494?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart updated WW-4494:
--
Affects Version/s: (was: 2.3.23)
   2.3.20

> Improve FreemarkerManager to activate new freemarker feature
> 
>
> Key: WW-4494
> URL: https://issues.apache.org/jira/browse/WW-4494
> Project: Struts 2
>  Issue Type: Improvement
>Affects Versions: 2.3.20
>Reporter: zhouyanming
> Fix For: 2.3.24
>
>
> http://freemarker.org/docs/pgui_config_incompatible_improvements.html#pgui_config_incompatible_improvements_how_to_set
> use "new Configuration(Configuration.VERSION_2_3_22)" instead of "new 
> Configuration( )"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (WW-4493) Still can't pass parameters with dashes to tags

2015-04-29 Thread Lukasz Lenart (JIRA)

 [ 
https://issues.apache.org/jira/browse/WW-4493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart updated WW-4493:
--
Affects Version/s: (was: 2.3.23)
   2.3.20

> Still can't pass parameters with dashes to tags
> ---
>
> Key: WW-4493
> URL: https://issues.apache.org/jira/browse/WW-4493
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Affects Versions: 2.3.20
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: freemarker, tags
> Fix For: 2.3.24
>
>
> The latest freemarker now supports dashes in attribute names, so I can write 
> something like:
> {code:xml}
> <@s.form name="sendToPhone" data\-ajax="false">
> 
> {code}
> Unfortunately, the parameters are set using ognl internally, so it blows up 
> with an error like: 
> {noformat}
> Caused by: ognl.InappropriateExpressionException: Inappropriate OGNL 
> expression: data - ajax
> at ognl.SimpleNode.setValueBody(SimpleNode.java:312)
> at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
> at ognl.SimpleNode.setValue(SimpleNode.java:301)
> at ognl.Ognl.setValue(Ognl.java:737)
> at com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:287)
> at com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:282)
> at 
> com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:340)
> at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:282)
> {noformat}
> I think there is a simple solution, which is to send any parameters with an 
> dash directly to the parameters map like so:
> {code:title=Component.java|borderStyle=solid}
> /**
>  * Pushes this component's parameter Map as well as the component itself 
> on to the stack
>  * and then copies the supplied parameters over. Because the component's 
> parameter Map is
>  * pushed before the component itself, any key-value pair that can't be 
> assigned to component
>  * will be set in the parameters Map.
>  *
>  * @param params  the parameters to copy.
>  */
> public void copyParams(Map params) {
> stack.push(parameters);
> stack.push(this);
> try {
> for (Object o : params.entrySet()) {
> Map.Entry entry = (Map.Entry) o;
> String key = (String) entry.getKey();
> 
> if (key.indexOf('-') >= 0) {
> // UI component attributes may contain hypens (e.g. 
> data-ajax), but ognl
> // can't handle that, and there can't be a component 
> property with a hypen
> // so into the parameters map it goes.
> parameters.put(key, entry.getValue());
> } else {
> stack.setValue(key, entry.getValue());
> }
> }
> } finally {
> stack.pop();
> stack.pop();
> }
> }
> {code}
> Hoping this can make it into 2.3.24, thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4493) Still can't pass parameters with dashes to tags

2015-04-29 Thread Jasper Rosenberg (JIRA)

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

Jasper Rosenberg commented on WW-4493:
--

Okay, I figured out why it doesn't work for me, but it is working for everyone 
else.  I have my struts configured to propagate OgnlExceptions. By default they 
are swallowed, so the exception I showed in the original bug report is dropped 
and the rendering continues just fine (I verified this by turning off the 
propagation of OgnlExceptions locally).

You can verify it by putting a breakpoint in 
OgnlValueStack.handleOgnlException(), and you will see that the only reason it 
is working for you is that throwExceptionOnFailure is false. 

My patch above will remove this as an issue for those of us who want to see 
OgnlExceptions (when I turned this on I found a lot of bugs in our code that 
had been previously masked.)  

Thanks!


> Still can't pass parameters with dashes to tags
> ---
>
> Key: WW-4493
> URL: https://issues.apache.org/jira/browse/WW-4493
> Project: Struts 2
>  Issue Type: Bug
>  Components: Expression Language
>Affects Versions: 2.3.23
>Reporter: Jasper Rosenberg
>Priority: Minor
>  Labels: freemarker, tags
> Fix For: 2.3.24
>
>
> The latest freemarker now supports dashes in attribute names, so I can write 
> something like:
> {code:xml}
> <@s.form name="sendToPhone" data\-ajax="false">
> 
> {code}
> Unfortunately, the parameters are set using ognl internally, so it blows up 
> with an error like: 
> {noformat}
> Caused by: ognl.InappropriateExpressionException: Inappropriate OGNL 
> expression: data - ajax
> at ognl.SimpleNode.setValueBody(SimpleNode.java:312)
> at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220)
> at ognl.SimpleNode.setValue(SimpleNode.java:301)
> at ognl.Ognl.setValue(Ognl.java:737)
> at com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:287)
> at com.opensymphony.xwork2.ognl.OgnlUtil$1.execute(OgnlUtil.java:282)
> at 
> com.opensymphony.xwork2.ognl.OgnlUtil.compileAndExecute(OgnlUtil.java:340)
> at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:282)
> {noformat}
> I think there is a simple solution, which is to send any parameters with an 
> dash directly to the parameters map like so:
> {code:title=Component.java|borderStyle=solid}
> /**
>  * Pushes this component's parameter Map as well as the component itself 
> on to the stack
>  * and then copies the supplied parameters over. Because the component's 
> parameter Map is
>  * pushed before the component itself, any key-value pair that can't be 
> assigned to component
>  * will be set in the parameters Map.
>  *
>  * @param params  the parameters to copy.
>  */
> public void copyParams(Map params) {
> stack.push(parameters);
> stack.push(this);
> try {
> for (Object o : params.entrySet()) {
> Map.Entry entry = (Map.Entry) o;
> String key = (String) entry.getKey();
> 
> if (key.indexOf('-') >= 0) {
> // UI component attributes may contain hypens (e.g. 
> data-ajax), but ognl
> // can't handle that, and there can't be a component 
> property with a hypen
> // so into the parameters map it goes.
> parameters.put(key, entry.getValue());
> } else {
> stack.setValue(key, entry.getValue());
> }
> }
> } finally {
> stack.pop();
> stack.pop();
> }
> }
> {code}
> Hoping this can make it into 2.3.24, thanks!



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (WW-4433) ConventionUnknownHandler change breaks exception handling in interceptors.

2015-04-29 Thread Lukasz Lenart (JIRA)

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

Lukasz Lenart commented on WW-4433:
---

2.3.23 test version was cancelled as there were some other issues discovered, 
2.3.24 will be pushed to test soon.

> ConventionUnknownHandler change breaks exception handling in interceptors.
> --
>
> Key: WW-4433
> URL: https://issues.apache.org/jira/browse/WW-4433
> Project: Struts 2
>  Issue Type: Bug
>  Components: Core Interceptors, Documentation, Plugin - Convention
>Affects Versions: 2.3.20
>Reporter: Joseph Wolschon
>Assignee: Lukasz Lenart
>Priority: Minor
> Fix For: 2.3.23
>
>
> Struts 2.3.20 appears to have caused a regression that prevents exceptions 
> thrown from convention-plugin actions from reaching 
> ExceptionMappingInterceptor. This breaks exception handling when using the 
> convention-plugin.
> To Reproduce: 
> * Generate a project struts2-archetype-convention archetype using 2.3.20
> * Throw exception in the action. With 2.3.20, a blank page is shown.
> * Change to 2.3.16.3 and you will get the standard struts2 error page.
> The breaking change appears to have been made in WW-4331. This causes error 
> interceptor code to break (showing a blank page when exceptions are thrown) 
> as DefaultActionInvocation does not catch an exception from the default 
> UnknownHandler implementation execution, which would previously re-throw the 
> original exception back up for the interceptors to catch. 
> Workaround:
> We've created our own UnknownHandler implementation that just throws a new 
> NoSuchMethodException, allowing DefaultActionInvocation to re-throw the 
> original exception so that our error interceptor can again catch it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)