[jira] [Commented] (WW-4509) MethodFilter accept wildcard
[ https://issues.apache.org/jira/browse/WW-4509?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14644825#comment-14644825 ] Aleksandr Mashchenko commented on WW-4509: -- What makes you think that method filter doesn't take wildcards? https://github.com/apache/struts/blob/master/core/src/main/java/com/opensymphony/xwork2/interceptor/MethodFilterInterceptorUtil.java. > MethodFilter accept wildcard > > > Key: WW-4509 > URL: https://issues.apache.org/jira/browse/WW-4509 > Project: Struts 2 > Issue Type: Improvement > Components: Core Interceptors >Reporter: Alireza Fattahi > Fix For: 2.5 > > > Is it a good idea to improve the interceptor filtering method to accept > wildcard (or RegEx) for include and exclude names. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WW-4530) The ExceptionMappingInterceptor extends MethodFilterInterceptor
[ https://issues.apache.org/jira/browse/WW-4530?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14644816#comment-14644816 ] Aleksandr Mashchenko commented on WW-4530: -- Why do you need this? Can you provide some real world example. > The ExceptionMappingInterceptor extends MethodFilterInterceptor > --- > > Key: WW-4530 > URL: https://issues.apache.org/jira/browse/WW-4530 > Project: Struts 2 > Issue Type: Bug >Reporter: Alireza Fattahi > Fix For: 2.5 > > > Is it possible that the ExceptionMappingInterceptor extends > MethodFilterInterceptor, this will help to add ExceptionMappingInterceptor > to defined methods -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (WW-4533) 404 error with @Action("/") when upgrading Struts2 REST 2.1.8 to 2.3.24
[ https://issues.apache.org/jira/browse/WW-4533?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4533: -- Description: I have a web app made using Struts 2 version 2.1.8, and its Convention and REST plugins. I needed to update it to the latest version (2.3.24) but one feature I used to have stopped working. I tracked the versions after 2.1.8, and found out that it was after version 2.3.7 that the problem started to happen. I have created a simple app called “upgradetest" to isolate the problem. Here is the error scenario: I have an Action called HomeController, in which I have a method index() that is marked with the @Action(“/“) annotation, so that the root url of the app maps to this method, like below: {code:java} package upgradetest.web.struts; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.rest.RestActionSupport; import upgradetest.model.Messages; public class HomeController extends RestActionSupport { private Messages messages; public HomeController() { } @Action("/") public String index() { messages = new Messages(); return show(); } public String show() { return "show"; } public Messages getMessages() { return messages; } } {code} Here is my struts.xml file: {code:xml} http://struts.apache.org/dtds/struts-2.3.dtd";> {code} Normally, by visiting the root url of my app (“/“) in Struts2 2.1.8, the index() method was called, and it then took the user to the desired result. After the upgrade to 2.3.7, the web app is returning a 404 error. I have investigated the source code and found out that the RestActionMapper of Struts Rest Plugin is returning null in the getMapping method (in the last line of code), something it did not in version 2.1.8. I believe this change was done for some reason so I was wondering: Is there a way to map the root url (“/“) to a specific action of mine without having to do a redirect or something like that (because of a SEO requirement I have)? Also, am I doing it the wrong way? was: I have a web app made using Struts 2 version 2.1.8, and its Convention and REST plugins. I needed to update it to the latest version (2.3.24) but one feature I used to have stopped working. I tracked the versions after 2.1.8, and found out that it was after version 2.3.7 that the problem started to happen. I have created a simple app called “upgradetest" to isolate the problem. Here is the error scenario: I have an Action called HomeController, in which I have a method index() that is marked with the @Action(“/“) annotation, so that the root url of the app maps to this method, like below: package upgradetest.web.struts; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.rest.RestActionSupport; import upgradetest.model.Messages; public class HomeController extends RestActionSupport { private Messages messages; public HomeController() { } @Action("/") public String index() { messages = new Messages(); return show(); } public String show() { return "show"; } public Messages getMessages() { return messages; } } Here is my struts.xml file: http://struts.apache.org/dtds/struts-2.3.dtd";> Normally, by visiting the root url of my app (“/“) in Struts2 2.1.8, the index() method was called, and it then took the user to the desired result. After the upgrade to 2.3.7, the web app is returning a 404 error. I have investigated the source code and found out that the RestActionMapper of Struts Rest Plugin is returning null in the getMapping method (in the last line of code), something it did not in version 2.1.8. I believe this change was done for some reason so I was wondering: Is there a way to map the root url (“/“) to a specific action of mine without having to do a redirect or something like that (because of a SEO requirement I have)? Also, am I doing it the wrong way? > 404 error with @Action("/") when upgrading Struts2 REST 2.1.8 to 2.3.24 > --- > > Key: WW-4533 > URL: https://issues.apache.org/jira/browse/WW-4533 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST >Affects Versions: 2.3.7, 2.3.8, 2.3.12, 2.3.14, 2.3.14.1, 2.3.14.2, > 2.3.14.3, 2.3.15, 2.3.15.1, 2.3.15.2, 2.3.15.3, 2.3.16, 2.3.16.1, 2.3.16.2, > 2.3.16.3, 2.3.20, 2.3.24 > Environment: *ix System, Tomcat 6.0.44, Java 1.6 >Reporter: Julio Aragao > Labels: Mapping, Plugin, REST, URL > Fix For: 2.3.x > > > I have a web
[jira] [Commented] (WW-4533) 404 error with @Action("/") when upgrading Struts2 REST 2.1.8 to 2.3.24
[ https://issues.apache.org/jira/browse/WW-4533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14644316#comment-14644316 ] Lukasz Lenart commented on WW-4533: --- The following discussion http://markmail.org/message/xyebqzuphxtih37p > 404 error with @Action("/") when upgrading Struts2 REST 2.1.8 to 2.3.24 > --- > > Key: WW-4533 > URL: https://issues.apache.org/jira/browse/WW-4533 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - REST >Affects Versions: 2.3.7, 2.3.8, 2.3.12, 2.3.14, 2.3.14.1, 2.3.14.2, > 2.3.14.3, 2.3.15, 2.3.15.1, 2.3.15.2, 2.3.15.3, 2.3.16, 2.3.16.1, 2.3.16.2, > 2.3.16.3, 2.3.20, 2.3.24 > Environment: *ix System, Tomcat 6.0.44, Java 1.6 >Reporter: Julio Aragao > Labels: Mapping, Plugin, REST, URL > Fix For: 2.3.x > > > I have a web app made using Struts 2 version 2.1.8, and its Convention and > REST plugins. I needed to update it to the latest version (2.3.24) but one > feature I used to have stopped working. I tracked the versions after 2.1.8, > and found out that it was after version 2.3.7 that the problem started to > happen. I have created a simple app called “upgradetest" to isolate the > problem. Here is the error scenario: > I have an Action called HomeController, in which I have a method index() that > is marked with the @Action(“/“) annotation, so that the root url of the app > maps to this method, like below: > {code:java} > package upgradetest.web.struts; > import org.apache.struts2.convention.annotation.Action; > import org.apache.struts2.rest.RestActionSupport; > import upgradetest.model.Messages; > public class HomeController extends RestActionSupport { > private Messages messages; > public HomeController() { > } > @Action("/") > public String index() { > messages = new Messages(); > return show(); > } > public String show() { > return "show"; > } > public Messages getMessages() { > return messages; > } > } > {code} > Here is my struts.xml file: > {code:xml} > > "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" > "http://struts.apache.org/dtds/struts-2.3.dtd";> > > > > > > value="global-resources" /> > > > > value="upgradetest"/> > > {code} > Normally, by visiting the root url of my app (“/“) in Struts2 2.1.8, the > index() method was called, and it then took the user to the desired result. > After the upgrade to 2.3.7, the web app is returning a 404 error. I have > investigated the source code and found out that the RestActionMapper of > Struts Rest Plugin is returning null in the getMapping method (in the last > line of code), something it did not in version 2.1.8. I believe this change > was done for some reason so I was wondering: > Is there a way to map the root url (“/“) to a specific action of mine without > having to do a redirect or something like that (because of a SEO requirement > I have)? Also, am I doing it the wrong way? -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (WW-4533) 404 error with @Action("/") when upgrading Struts2 REST 2.1.8 to 2.3.24
Julio Aragao created WW-4533: Summary: 404 error with @Action("/") when upgrading Struts2 REST 2.1.8 to 2.3.24 Key: WW-4533 URL: https://issues.apache.org/jira/browse/WW-4533 Project: Struts 2 Issue Type: Bug Components: Plugin - REST Affects Versions: 2.3.24, 2.3.20, 2.3.16.3, 2.3.16.2, 2.3.16.1, 2.3.16, 2.3.15.3, 2.3.15.2, 2.3.15.1, 2.3.15, 2.3.14.3, 2.3.14.2, 2.3.14.1, 2.3.14, 2.3.12, 2.3.8, 2.3.7 Environment: *ix System, Tomcat 6.0.44, Java 1.6 Reporter: Julio Aragao Fix For: 2.3.x I have a web app made using Struts 2 version 2.1.8, and its Convention and REST plugins. I needed to update it to the latest version (2.3.24) but one feature I used to have stopped working. I tracked the versions after 2.1.8, and found out that it was after version 2.3.7 that the problem started to happen. I have created a simple app called “upgradetest" to isolate the problem. Here is the error scenario: I have an Action called HomeController, in which I have a method index() that is marked with the @Action(“/“) annotation, so that the root url of the app maps to this method, like below: package upgradetest.web.struts; import org.apache.struts2.convention.annotation.Action; import org.apache.struts2.rest.RestActionSupport; import upgradetest.model.Messages; public class HomeController extends RestActionSupport { private Messages messages; public HomeController() { } @Action("/") public String index() { messages = new Messages(); return show(); } public String show() { return "show"; } public Messages getMessages() { return messages; } } Here is my struts.xml file: http://struts.apache.org/dtds/struts-2.3.dtd";> Normally, by visiting the root url of my app (“/“) in Struts2 2.1.8, the index() method was called, and it then took the user to the desired result. After the upgrade to 2.3.7, the web app is returning a 404 error. I have investigated the source code and found out that the RestActionMapper of Struts Rest Plugin is returning null in the getMapping method (in the last line of code), something it did not in version 2.1.8. I believe this change was done for some reason so I was wondering: Is there a way to map the root url (“/“) to a specific action of mine without having to do a redirect or something like that (because of a SEO requirement I have)? Also, am I doing it the wrong way? -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WW-4532) Javascript generated by s:doubleselect has global variables that can interfer with the rest of the app
[ https://issues.apache.org/jira/browse/WW-4532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14644283#comment-14644283 ] Pierre Henry commented on WW-4532: -- You are right. In the case that caused an error on my page, the loop was inside a function so the {{var}} could have fixed it, the scope of the variable became the function. But such loops are also created outside of functions. > Javascript generated by s:doubleselect has global variables that can interfer > with the rest of the app > -- > > Key: WW-4532 > URL: https://issues.apache.org/jira/browse/WW-4532 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - Tags >Affects Versions: 2.3.20 >Reporter: Pierre Henry > Labels: javascript > Fix For: 2.5.x > > > In the JavaScript code generated by the {{s:doubleselect}} tag (and, possibly > other tags), there are for loops using the following format : > {code} > for (m = ObservationForm_observation_countryKeyTemp.options.length - 1; m >= > 0; m--) { > ObservationForm_observation_countryKeyTemp.options[m] = null; > {code} > The variable {{m}} is never defined before that. So this creates a globally > scoped {{m}} variable that can interfere with other JavaScript code. > In my case it interfered with library code that is processed with a minifyer > (I think in this case it is Google Closure Compiler) and contains a lot of > one-letter variable name, such as... {{m}}. > So I got the following error : > {code} > Uncaught TypeError: number is not a function > {code} > Which was difficult to trace since the code was minified. If the code was not > minified, then the error did not happen any more. > I believe it would be enough to just use the var keyword in the loop > definition to remove this problem : > {code} > for (var m = ObservationForm_observation_countryKeyTemp.options.length - 1; m > >= 0; m--) { > ObservationForm_observation_countryKeyTemp.options[m] = null; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WW-4532) Javascript generated by s:doubleselect has global variables that can interfer with the rest of the app
[ https://issues.apache.org/jira/browse/WW-4532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14644277#comment-14644277 ] Lukasz Lenart commented on WW-4532: --- but {{var}} will define a global variable again - it'll be the same. I think it would be better to rename the variable and put it upfront. > Javascript generated by s:doubleselect has global variables that can interfer > with the rest of the app > -- > > Key: WW-4532 > URL: https://issues.apache.org/jira/browse/WW-4532 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - Tags >Affects Versions: 2.3.20 >Reporter: Pierre Henry > Labels: javascript > Fix For: 2.5.x > > > In the JavaScript code generated by the {{s:doubleselect}} tag (and, possibly > other tags), there are for loops using the following format : > {code} > for (m = ObservationForm_observation_countryKeyTemp.options.length - 1; m >= > 0; m--) { > ObservationForm_observation_countryKeyTemp.options[m] = null; > {code} > The variable {{m}} is never defined before that. So this creates a globally > scoped {{m}} variable that can interfere with other JavaScript code. > In my case it interfered with library code that is processed with a minifyer > (I think in this case it is Google Closure Compiler) and contains a lot of > one-letter variable name, such as... {{m}}. > So I got the following error : > {code} > Uncaught TypeError: number is not a function > {code} > Which was difficult to trace since the code was minified. If the code was not > minified, then the error did not happen any more. > I believe it would be enough to just use the var keyword in the loop > definition to remove this problem : > {code} > for (var m = ObservationForm_observation_countryKeyTemp.options.length - 1; m > >= 0; m--) { > ObservationForm_observation_countryKeyTemp.options[m] = null; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (WW-4532) Javascript generated by s:doubleselect has global variables that can interfer with the rest of the app
[ https://issues.apache.org/jira/browse/WW-4532?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Lukasz Lenart updated WW-4532: -- Fix Version/s: 2.5.x > Javascript generated by s:doubleselect has global variables that can interfer > with the rest of the app > -- > > Key: WW-4532 > URL: https://issues.apache.org/jira/browse/WW-4532 > Project: Struts 2 > Issue Type: Bug > Components: Plugin - Tags >Affects Versions: 2.3.20 >Reporter: Pierre Henry > Labels: javascript > Fix For: 2.5.x > > > In the JavaScript code generated by the {{s:doubleselect}} tag (and, possibly > other tags), there are for loops using the following format : > {code} > for (m = ObservationForm_observation_countryKeyTemp.options.length - 1; m >= > 0; m--) { > ObservationForm_observation_countryKeyTemp.options[m] = null; > {code} > The variable {{m}} is never defined before that. So this creates a globally > scoped {{m}} variable that can interfere with other JavaScript code. > In my case it interfered with library code that is processed with a minifyer > (I think in this case it is Google Closure Compiler) and contains a lot of > one-letter variable name, such as... {{m}}. > So I got the following error : > {code} > Uncaught TypeError: number is not a function > {code} > Which was difficult to trace since the code was minified. If the code was not > minified, then the error did not happen any more. > I believe it would be enough to just use the var keyword in the loop > definition to remove this problem : > {code} > for (var m = ObservationForm_observation_countryKeyTemp.options.length - 1; m > >= 0; m--) { > ObservationForm_observation_countryKeyTemp.options[m] = null; > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (WW-4532) Javascript generated by s:doubleselect has global variables that can interfer with the rest of the app
Pierre Henry created WW-4532: Summary: Javascript generated by s:doubleselect has global variables that can interfer with the rest of the app Key: WW-4532 URL: https://issues.apache.org/jira/browse/WW-4532 Project: Struts 2 Issue Type: Bug Components: Plugin - Tags Affects Versions: 2.3.20 Reporter: Pierre Henry In the JavaScript code generated by the {{s:doubleselect}} tag (and, possibly other tags), there are for loops using the following format : {code} for (m = ObservationForm_observation_countryKeyTemp.options.length - 1; m >= 0; m--) { ObservationForm_observation_countryKeyTemp.options[m] = null; {code} The variable {{m}} is never defined before that. So this creates a globally scoped {{m}} variable that can interfere with other JavaScript code. In my case it interfered with library code that is processed with a minifyer (I think in this case it is Google Closure Compiler) and contains a lot of one-letter variable name, such as... {{m}}. So I got the following error : {code} Uncaught TypeError: number is not a function {code} Which was difficult to trace since the code was minified. If the code was not minified, then the error did not happen any more. I believe it would be enough to just use the var keyword in the loop definition to remove this problem : {code} for (var m = ObservationForm_observation_countryKeyTemp.options.length - 1; m >= 0; m--) { ObservationForm_observation_countryKeyTemp.options[m] = null; {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)