[jira] [Comment Edited] (WW-4921) NPE in I18nInterceptor$SessionLocaleHandler.read
[ https://issues.apache.org/jira/browse/WW-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16372464#comment-16372464 ] Michael Hintenaus edited comment on WW-4921 at 2/22/18 7:16 AM: No session is no alternative for me. Setting a Map is my workaround (see below). But as mentioned by [~yasser.zamani] : StrutsTestCase has a {{initActionContext}} Method (which sets the map automatically), StrutsJUnit4TestCase has not such a method - why? {code:java} @Override protected ActionProxy getActionProxy(final String uri) { final ActionProxy proxy = super.getActionProxy(uri); final ActionContext context = proxy.getInvocation().getInvocationContext(); if (context.getSession() == null) { context.setSession(new SessionMap<>(request)); } return proxy; }{code} was (Author: michael hintenaus): No session is no alternative for me. Setting a Map is my workaround (see below). But as mentioned by [~yasser.zamani] : StrutsTestCase has a {{initActionContext}} Method (which set the map automatically), StrutsJUnit4TestCase has not such a method - why? {code:java} @Override protected ActionProxy getActionProxy(final String uri) { final ActionProxy proxy = super.getActionProxy(uri); final ActionContext context = proxy.getInvocation().getInvocationContext(); if (context.getSession() == null) { context.setSession(new SessionMap<>(request)); } return proxy; }{code} > NPE in I18nInterceptor$SessionLocaleHandler.read > > > Key: WW-4921 > URL: https://issues.apache.org/jira/browse/WW-4921 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Reporter: Michael Hintenaus >Priority: Major > Labels: test > Fix For: 2.5.16 > > > Calling > {code:java} > getActionProxy("/index.action").getInvocation().invoke(){code} > in a TestCase which extends from StrutsJUnit4TestCase will lead to a > NullPointerException. > Overriding getActionProxy like this will help: > {code:java} > @Override > protected ActionProxy getActionProxy(final String uri) { > final ActionProxy proxy = super.getActionProxy(uri); > final ActionContext context = > proxy.getInvocation().getInvocationContext(); > if (context.getSession() == null) { > context.setSession(new SessionMap<>(request)); > } > return proxy; > }{code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WW-4921) NPE in I18nInterceptor$SessionLocaleHandler.read
[ https://issues.apache.org/jira/browse/WW-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16372464#comment-16372464 ] Michael Hintenaus commented on WW-4921: --- No session is no alternative for me. Setting a Map is my workaround (see below). But as mentioned by [~yasser.zamani] : StrutsTestCase has a {{initActionContext}} Method (which set the map automatically), StrutsJUnit4TestCase has not such a method - why? {code:java} @Override protected ActionProxy getActionProxy(final String uri) { final ActionProxy proxy = super.getActionProxy(uri); final ActionContext context = proxy.getInvocation().getInvocationContext(); if (context.getSession() == null) { context.setSession(new SessionMap<>(request)); } return proxy; }{code} > NPE in I18nInterceptor$SessionLocaleHandler.read > > > Key: WW-4921 > URL: https://issues.apache.org/jira/browse/WW-4921 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Reporter: Michael Hintenaus >Priority: Major > Labels: test > Fix For: 2.5.16 > > > Calling > {code:java} > getActionProxy("/index.action").getInvocation().invoke(){code} > in a TestCase which extends from StrutsJUnit4TestCase will lead to a > NullPointerException. > Overriding getActionProxy like this will help: > {code:java} > @Override > protected ActionProxy getActionProxy(final String uri) { > final ActionProxy proxy = super.getActionProxy(uri); > final ActionContext context = > proxy.getInvocation().getInvocationContext(); > if (context.getSession() == null) { > context.setSession(new SessionMap<>(request)); > } > return proxy; > }{code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WW-4921) NPE in I18nInterceptor$SessionLocaleHandler.read
[ https://issues.apache.org/jira/browse/WW-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16371077#comment-16371077 ] Michael Hintenaus commented on WW-4921: --- with Struts 2.5.14.1 it works fine, with Struts 2.5.15 the test will fail {code:java} @Action(results = @Result(location="http://struts.apache.org;, type="redirect")) public class MyAction extends ActionSupport { } {code} {code:java} public class MyTest extends StrutsJUnit4TestCase { @Test public void test() throws Exception { request.getSession(true); final ActionProxy proxy = getActionProxy("/my-action.action"); final ActionInvocation invocation = proxy.getInvocation(); invocation.invoke(); assertTrue(invocation.isExecuted()); assertEquals(MyAction.SUCCESS, invocation.getResultCode()); } }{code} {code:java} java.lang.NullPointerException at org.apache.struts2.interceptor.I18nInterceptor$SessionLocaleHandler.read(I18nInterceptor.java:308) at org.apache.struts2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:107) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:167) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:249) at com.silbergrau.cal6.MyTest.test(MyTest.java:20){code} > NPE in I18nInterceptor$SessionLocaleHandler.read > > > Key: WW-4921 > URL: https://issues.apache.org/jira/browse/WW-4921 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Reporter: Michael Hintenaus >Priority: Major > Labels: test > Fix For: 2.5.16 > > > Calling > {code:java} > getActionProxy("/index.action").getInvocation().invoke(){code} > in a TestCase which extends from StrutsJUnit4TestCase will lead to a > NullPointerException. > Overriding getActionProxy like this will help: > {code:java} > @Override > protected ActionProxy getActionProxy(final String uri) { > final ActionProxy proxy = super.getActionProxy(uri); > final ActionContext context = > proxy.getInvocation().getInvocationContext(); > if (context.getSession() == null) { > context.setSession(new SessionMap<>(request)); > } > return proxy; > }{code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Comment Edited] (WW-4921) NPE in I18nInterceptor$SessionLocaleHandler.read
[ https://issues.apache.org/jira/browse/WW-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16369851#comment-16369851 ] Michael Hintenaus edited comment on WW-4921 at 2/20/18 9:38 AM: Calling execute() of ActionProxy, also calls invoke() and I will also get a NPE. Calling executeAction() will solve the problem, but I want to assert the return code of the action... was (Author: michael hintenaus): calling execute() of ActionProxy, also calls invoke() and I will also get a NPE. Calling executeAction will solve the problem, but I want to assert the return code of the action... > NPE in I18nInterceptor$SessionLocaleHandler.read > > > Key: WW-4921 > URL: https://issues.apache.org/jira/browse/WW-4921 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Reporter: Michael Hintenaus >Priority: Major > Labels: test > Fix For: 2.5.16 > > > Calling > {code:java} > getActionProxy("/index.action").getInvocation().invoke(){code} > in a TestCase which extends from StrutsJUnit4TestCase will lead to a > NullPointerException. > Overriding getActionProxy like this will help: > {code:java} > @Override > protected ActionProxy getActionProxy(final String uri) { > final ActionProxy proxy = super.getActionProxy(uri); > final ActionContext context = > proxy.getInvocation().getInvocationContext(); > if (context.getSession() == null) { > context.setSession(new SessionMap<>(request)); > } > return proxy; > }{code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WW-4921) NPE in I18nInterceptor$SessionLocaleHandler.read
[ https://issues.apache.org/jira/browse/WW-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16369851#comment-16369851 ] Michael Hintenaus commented on WW-4921: --- calling execute() of ActionProxy, also calls invoke() and I will also get a NPE. Calling executeAction will solve the problem, but I want to assert the return code of the action... > NPE in I18nInterceptor$SessionLocaleHandler.read > > > Key: WW-4921 > URL: https://issues.apache.org/jira/browse/WW-4921 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Reporter: Michael Hintenaus >Priority: Major > Labels: test > Fix For: 2.5.16 > > > Calling > {code:java} > getActionProxy("/index.action").getInvocation().invoke(){code} > in a TestCase which extends from StrutsJUnit4TestCase will lead to a > NullPointerException. > Overriding getActionProxy like this will help: > {code:java} > @Override > protected ActionProxy getActionProxy(final String uri) { > final ActionProxy proxy = super.getActionProxy(uri); > final ActionContext context = > proxy.getInvocation().getInvocationContext(); > if (context.getSession() == null) { > context.setSession(new SessionMap<>(request)); > } > return proxy; > }{code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (WW-4921) NPE in I18nInterceptor$SessionLocaleHandler.read
[ https://issues.apache.org/jira/browse/WW-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16369125#comment-16369125 ] Michael Hintenaus commented on WW-4921: --- No, I didn't consider using the old fashion StrutsTestCase, I wan't to use JUnit4 features... > NPE in I18nInterceptor$SessionLocaleHandler.read > > > Key: WW-4921 > URL: https://issues.apache.org/jira/browse/WW-4921 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Reporter: Michael Hintenaus >Priority: Major > Labels: test > > Calling > {code:java} > getActionProxy("/index.action").getInvocation().invoke(){code} > in a TestCase which extends from StrutsJUnit4TestCase will lead to a > NullPointerException. > Overriding getActionProxy like this will help: > {code:java} > @Override > protected ActionProxy getActionProxy(final String uri) { > final ActionProxy proxy = super.getActionProxy(uri); > final ActionContext context = > proxy.getInvocation().getInvocationContext(); > if (context.getSession() == null) { > context.setSession(new SessionMap<>(request)); > } > return proxy; > }{code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Updated] (WW-4921) NPE in I18nInterceptor$SessionLocaleHandler.read
[ https://issues.apache.org/jira/browse/WW-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Hintenaus updated WW-4921: -- Description: Calling {code:java} getActionProxy("/index.action").getInvocation().invoke(){code} in a TestCase which extends from StrutsJUnit4TestCase will lead to a NullPointerException. Overriding getActionProxy like this will help: {code:java} @Override protected ActionProxy getActionProxy(final String uri) { final ActionProxy proxy = super.getActionProxy(uri); final ActionContext context = proxy.getInvocation().getInvocationContext(); if (context.getSession() == null) { context.setSession(new SessionMap<>(request)); } return proxy; }{code} was: Calling {code:java} getActionProxy("/index.action").getInvocation().invoke(){code} in a TestCase which extendsStrutsJUnit4TestCase will lead to a NullPointerException. Overriding getActionProxy like this will help: {code:java} @Override protected ActionProxy getActionProxy(final String uri) { final ActionProxy proxy = super.getActionProxy(uri); final ActionContext context = proxy.getInvocation().getInvocationContext(); if (context.getSession() == null) { context.setSession(new SessionMap<>(request)); } return proxy; }{code} > NPE in I18nInterceptor$SessionLocaleHandler.read > > > Key: WW-4921 > URL: https://issues.apache.org/jira/browse/WW-4921 > Project: Struts 2 > Issue Type: Bug > Components: Core Interceptors >Reporter: Michael Hintenaus >Priority: Major > Labels: test > > Calling > {code:java} > getActionProxy("/index.action").getInvocation().invoke(){code} > in a TestCase which extends from StrutsJUnit4TestCase will lead to a > NullPointerException. > Overriding getActionProxy like this will help: > {code:java} > @Override > protected ActionProxy getActionProxy(final String uri) { > final ActionProxy proxy = super.getActionProxy(uri); > final ActionContext context = > proxy.getInvocation().getInvocationContext(); > if (context.getSession() == null) { > context.setSession(new SessionMap<>(request)); > } > return proxy; > }{code} > -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (WW-4921) NPE in I18nInterceptor$SessionLocaleHandler.read
Michael Hintenaus created WW-4921: - Summary: NPE in I18nInterceptor$SessionLocaleHandler.read Key: WW-4921 URL: https://issues.apache.org/jira/browse/WW-4921 Project: Struts 2 Issue Type: Bug Components: Core Interceptors Reporter: Michael Hintenaus Calling {code:java} getActionProxy("/index.action").getInvocation().invoke(){code} in a TestCase which extendsStrutsJUnit4TestCase will lead to a NullPointerException. Overriding getActionProxy like this will help: {code:java} @Override protected ActionProxy getActionProxy(final String uri) { final ActionProxy proxy = super.getActionProxy(uri); final ActionContext context = proxy.getInvocation().getInvocationContext(); if (context.getSession() == null) { context.setSession(new SessionMap<>(request)); } return proxy; }{code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (WW-4866) ASM 5.2 and Java 9 leads to IllegalArgumentException
Michael Hintenaus created WW-4866: - Summary: ASM 5.2 and Java 9 leads to IllegalArgumentException Key: WW-4866 URL: https://issues.apache.org/jira/browse/WW-4866 Project: Struts 2 Issue Type: Bug Components: Plugin - Convention Affects Versions: 2.5.13 Environment: Java 9 Reporter: Michael Hintenaus Priority: Critical With ASM 5.2 and Java 9 I will get the following Stacktrace: java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at org.objectweb.asm.ClassReader.(Unknown Source) at org.apache.struts2.convention.DefaultClassFinder.readClassDef(DefaultClassFinder.java:461) at org.apache.struts2.convention.DefaultClassFinder.access$200(DefaultClassFinder.java:52) at org.apache.struts2.convention.DefaultClassFinder$InfoBuildingVisitor.extractSuperInterfaces(DefaultClassFinder.java:514) at org.apache.struts2.convention.DefaultClassFinder$InfoBuildingVisitor.visit(DefaultClassFinder.java:501) at org.objectweb.asm.ClassReader.accept(Unknown Source) at org.objectweb.asm.ClassReader.accept(Unknown Source) at org.apache.struts2.convention.DefaultClassFinder.readClassDef(DefaultClassFinder.java:462) at org.apache.struts2.convention.DefaultClassFinder.(DefaultClassFinder.java:93) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildClassFinder(PackageBasedActionConfigBuilder.java:395) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.findActions(PackageBasedActionConfigBuilder.java:377) at org.apache.struts2.convention.PackageBasedActionConfigBuilder.buildActionConfigs(PackageBasedActionConfigBuilder.java:333) at org.apache.struts2.convention.ClasspathPackageProvider.loadPackages(ClasspathPackageProvider.java:52) at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:198) at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:63) at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:960) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:466) at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:499) at org.apache.struts2.util.StrutsTestCaseHelper.initDispatcher(StrutsTestCaseHelper.java:47) at org.apache.struts2.StrutsJUnit4TestCase.initDispatcher(StrutsJUnit4TestCase.java:247) at org.apache.struts2.StrutsJUnit4TestCase.setUp(StrutsJUnit4TestCase.java:236) -- This message was sent by Atlassian JIRA (v6.4.14#64029)
[jira] [Commented] (WW-4729) ServletDispatcherResult can't handle parameters anymore
[ https://issues.apache.org/jira/browse/WW-4729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15978284#comment-15978284 ] Michael Hintenaus commented on WW-4729: --- https://issues.apache.org/jira/browse/WW-4788 > ServletDispatcherResult can't handle parameters anymore > --- > > Key: WW-4729 > URL: https://issues.apache.org/jira/browse/WW-4729 > Project: Struts 2 > Issue Type: Bug > Components: Core Results >Affects Versions: 2.5.5, 2.5.8 >Reporter: Michael Hintenaus >Assignee: Lukasz Lenart > Fix For: 2.5.10 > > > I have an action like this > {code:title=Bar.java|borderStyle=solid} > @Action(value = "execute", results = @Result(name = SUCCESS, type = > DISPATCHER, location = "index.jsp?foo=bar")) > public String execute() { > return super.execute(); > } > {code} > which leads to an error in the ServletDispatcherResult > {noformat} > java.lang.IllegalAccessError: HttpParameters are immutable, you cannot put > values directly! > at > org.apache.struts2.dispatcher.HttpParameters.putAll(HttpParameters.java:132) > at > org.apache.struts2.result.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:148) > at > org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208) >at > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:270) > > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Created] (WW-4788) Parameters which are added via ServletDispatcherResult aren't availabe in #parameters
Michael Hintenaus created WW-4788: - Summary: Parameters which are added via ServletDispatcherResult aren't availabe in #parameters Key: WW-4788 URL: https://issues.apache.org/jira/browse/WW-4788 Project: Struts 2 Issue Type: Bug Components: Core Results, Value Stack Affects Versions: 2.5.10 Reporter: Michael Hintenaus Fix For: 2.5.next before Version 2.5.5 the parameters were accessible via #parameters (example: #parameters.foo) now I won't get the parameters which are defined via location, only the request parameters I have an action like this {code:title=MyTest.java|borderStyle=solid} @Action(value = "execute", results = @Result(name = SUCCESS, type = DISPATCHER, location = "index.jsp?foo=bar")) public String execute() { return super.execute(); } {code} and that's the TestCase {code:title=MyTest.java|borderStyle=solid} @Test public void testParameters() throws UnsupportedEncodingException, ServletException { request.addParameter("test", "me"); executeAction("/test/dispatcher/execute.html"); assertEquals("me", findValueAfterExecute("#parameters.test[0]")); assertEquals("bar", findValueAfterExecute("#parameters.foo[0]")); } {code} my current workaround: {code} #attr['com.opensymphony.xwork2.ActionContext.parameters'].foo {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (WW-4729) ServletDispatcherResult can't handle parameters anymore
[ https://issues.apache.org/jira/browse/WW-4729?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15978196#comment-15978196 ] Michael Hintenaus commented on WW-4729: --- before Version 2.5.5 the parameters where accessible via #parameters (example: #parameters.foo) now I won't get the parameters which are defined via location, only the request parameters > ServletDispatcherResult can't handle parameters anymore > --- > > Key: WW-4729 > URL: https://issues.apache.org/jira/browse/WW-4729 > Project: Struts 2 > Issue Type: Bug > Components: Core Results >Affects Versions: 2.5.5, 2.5.8 >Reporter: Michael Hintenaus >Assignee: Lukasz Lenart > Fix For: 2.5.10 > > > I have an action like this > {code:title=Bar.java|borderStyle=solid} > @Action(value = "execute", results = @Result(name = SUCCESS, type = > DISPATCHER, location = "index.jsp?foo=bar")) > public String execute() { > return super.execute(); > } > {code} > which leads to an error in the ServletDispatcherResult > {noformat} > java.lang.IllegalAccessError: HttpParameters are immutable, you cannot put > values directly! > at > org.apache.struts2.dispatcher.HttpParameters.putAll(HttpParameters.java:132) > at > org.apache.struts2.result.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:148) > at > org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208) >at > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:270) > > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Created] (WW-4787) TestCase XWorkMapPropertyAccessorTest should be moved to src/test/java
Michael Hintenaus created WW-4787: - Summary: TestCase XWorkMapPropertyAccessorTest should be moved to src/test/java Key: WW-4787 URL: https://issues.apache.org/jira/browse/WW-4787 Project: Struts 2 Issue Type: Improvement Components: Core Affects Versions: 2.5.10 Reporter: Michael Hintenaus Priority: Minor Fix For: 2.5.next TestCase should be moved from src/main/java to src/test/java -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Updated] (WW-4729) ServletDispatcherResult can't handle parameters anymore
[ https://issues.apache.org/jira/browse/WW-4729?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Hintenaus updated WW-4729: -- Description: I have an action like this {code:title=Bar.java|borderStyle=solid} @Action(value = "execute", results = @Result(name = SUCCESS, type = DISPATCHER, location = "index.jsp?foo=bar")) public String execute() { return super.execute(); } {code} which leads to an error in the ServletDispatcherResult java.lang.IllegalAccessError: HttpParameters are immutable, you cannot put values directly! at org.apache.struts2.dispatcher.HttpParameters.putAll(HttpParameters.java:132) at org.apache.struts2.result.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:148) at org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:270) was: I have an action like this {code:title=Bar.java|borderStyle=solid} @Action(value = "execute", results = @Result(name = SUCCESS, type = DISPATCHER, location = "index.jsp?foo=bar")) public String getFoo() { return super.execute(); } {code} which leads to an error in the ServletDispatcherResult java.lang.IllegalAccessError: HttpParameters are immutable, you cannot put values directly! at org.apache.struts2.dispatcher.HttpParameters.putAll(HttpParameters.java:132) at org.apache.struts2.result.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:148) at org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:270) > ServletDispatcherResult can't handle parameters anymore > --- > > Key: WW-4729 > URL: https://issues.apache.org/jira/browse/WW-4729 > Project: Struts 2 > Issue Type: Bug > Components: Core Results >Affects Versions: 2.5.5, 2.5.8 >Reporter: Michael Hintenaus > Fix For: 2.5.next > > > I have an action like this > {code:title=Bar.java|borderStyle=solid} > @Action(value = "execute", results = @Result(name = SUCCESS, type = > DISPATCHER, location = "index.jsp?foo=bar")) > public String execute() { > return super.execute(); > } > {code} > which leads to an error in the ServletDispatcherResult > java.lang.IllegalAccessError: HttpParameters are immutable, you cannot put > values directly! > at > org.apache.struts2.dispatcher.HttpParameters.putAll(HttpParameters.java:132) > at > org.apache.struts2.result.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:148) > at > org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208) >at > com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366) > at > com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:270) > -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (WW-4729) ServletDispatcherResult can't handle parameters anymore
Michael Hintenaus created WW-4729: - Summary: ServletDispatcherResult can't handle parameters anymore Key: WW-4729 URL: https://issues.apache.org/jira/browse/WW-4729 Project: Struts 2 Issue Type: Bug Components: Core Results Affects Versions: 2.5.8, 2.5.5 Reporter: Michael Hintenaus Fix For: 2.5.next I have an action like this {code:title=Bar.java|borderStyle=solid} @Action(value = "execute", results = @Result(name = SUCCESS, type = DISPATCHER, location = "index.jsp?foo=bar")) public String getFoo() { return super.execute(); } {code} which leads to an error in the ServletDispatcherResult java.lang.IllegalAccessError: HttpParameters are immutable, you cannot put values directly! at org.apache.struts2.dispatcher.HttpParameters.putAll(HttpParameters.java:132) at org.apache.struts2.result.ServletDispatcherResult.doExecute(ServletDispatcherResult.java:148) at org.apache.struts2.result.StrutsResultSupport.execute(StrutsResultSupport.java:208) at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:270) -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WW-4447) Hidden fields silently drop 'label' attributes in Struts 2.3.20
[ https://issues.apache.org/jira/browse/WW-4447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14275438#comment-14275438 ] Michael Hintenaus commented on WW-4447: --- We are extending from the xhtml theme and since struts 2.3.20 some of our layouts are destroyed. The reason is the new hardecoded tr and td tag in the hidden.ftl. I can't understand this change in bug 4297, because I can't find any other ftl with table specific markup. I think it was a dirty fix. Hidden fields silently drop 'label' attributes in Struts 2.3.20 --- Key: WW-4447 URL: https://issues.apache.org/jira/browse/WW-4447 Project: Struts 2 Issue Type: Bug Components: Expression Language Affects Versions: 2.3.20 Environment: Freemarker 2.3.21 Reporter: Mitth'raw'nuruodo Priority: Minor Labels: hidden, label Fix For: 2.3.x Hidden fields (populated in a Freemarker template using @s.hidden) are silently dropping the 'label' attribute, as of Struts 2.3.20. Renaming the attribute to anything else works. We are using the s.hidden tag with a custom theme to display read-only fields on the page, and we make use of the label attribute. This change could be intended behavior for hidden fields, but it was not the case in 2.3.16.3, and I could not find anything in the changelog for 2.3.20. -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (WW-4430) using style attribute leads to a JasperException
[ https://issues.apache.org/jira/browse/WW-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Hintenaus updated WW-4430: -- Fix Version/s: (was: 2.3.x) 2.3.21 using style attribute leads to a JasperException Key: WW-4430 URL: https://issues.apache.org/jira/browse/WW-4430 Project: Struts 2 Issue Type: Bug Components: Plugin - Tags Affects Versions: 2.3.20 Environment: Tomcat 7.0.57 Reporter: Michael Hintenaus Fix For: 2.3.21 Attachments: stacktrace {code:xml} s:select list=versionen cssClass=selectxs style=width: 120px; / {code} leads to: org.apache.jasper.JasperException: /tiles/header.jsp (line: 28, column: 2) Unable to find setter method for attribute: style {code:xml} s:select list=versionen cssClass=selectxs cssStyle=width: 120px; / {code} everything is fine -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Created] (WW-4430) using style attribute leads to a JasperException
Michael Hintenaus created WW-4430: - Summary: using style attribute leads to a JasperException Key: WW-4430 URL: https://issues.apache.org/jira/browse/WW-4430 Project: Struts 2 Issue Type: Bug Components: Plugin - Tiles Affects Versions: 2.3.20 Environment: Tomcat 7.0.57 Reporter: Michael Hintenaus Fix For: 2.3.x {code:xml} s:select list=versionen cssClass=selectxs style=width: 120px; / {code} leads to: org.apache.jasper.JasperException: /tiles/header.jsp (line: 28, column: 2) Unable to find setter method for attribute: style {code:xml} s:select list=versionen cssClass=selectxs cssStyle=width: 120px; / {code} everything is fine -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Updated] (WW-4430) using style attribute leads to a JasperException
[ https://issues.apache.org/jira/browse/WW-4430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Hintenaus updated WW-4430: -- Attachment: stacktrace the whole stacktrace using style attribute leads to a JasperException Key: WW-4430 URL: https://issues.apache.org/jira/browse/WW-4430 Project: Struts 2 Issue Type: Bug Components: Plugin - Tags Affects Versions: 2.3.20 Environment: Tomcat 7.0.57 Reporter: Michael Hintenaus Fix For: 2.3.x Attachments: stacktrace {code:xml} s:select list=versionen cssClass=selectxs style=width: 120px; / {code} leads to: org.apache.jasper.JasperException: /tiles/header.jsp (line: 28, column: 2) Unable to find setter method for attribute: style {code:xml} s:select list=versionen cssClass=selectxs cssStyle=width: 120px; / {code} everything is fine -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WW-4404) Implement HttpInterceptor
[ https://issues.apache.org/jira/browse/WW-4404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14228153#comment-14228153 ] Michael Hintenaus commented on WW-4404: --- Using @AllowedHttpMethod as Meta-Annotation would be a possibility, so the interceptor has to check the @AllowedHttpMethod itself and all annotations which have annotated the @AllowedHttpMethod. Example: {code} @AllowedHttpMethod(HttpMethod.GET) public @interface HttpGet {} {code} An advantage is that the user can create his own Annotation which aren't provided from the framework: {code} @AllowedHttpMethod(HttpMethod.TRACE) public @interface HttpTrace {} {code} Implement HttpInterceptor - Key: WW-4404 URL: https://issues.apache.org/jira/browse/WW-4404 Project: Struts 2 Issue Type: Improvement Components: Core Interceptors Affects Versions: 2.3.20 Reporter: Lukasz Lenart Priority: Minor Fix For: 2.5 Allows limit access to actions based on used Http method type https://github.com/apache/struts/pull/25 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WW-4404) Implement HttpInterceptor
[ https://issues.apache.org/jira/browse/WW-4404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14227523#comment-14227523 ] Michael Hintenaus commented on WW-4404: --- I have some notes: HttpMethodInterceptor#HTTP_METHOD_ANNOTATIONS doesn't contain HttpPut and HttpDelete HttpMethodInterceptor#intercept checks invocation.getProxy().isMethodSpecified() which means a normal action-method won't be checked because it's not method-specific. For example it's method-specific if a sent parameter method:cancel but that's not the default-way. First we have to check the method of the proxy, then the action-method of the proxy and at least the action-class why we have the possibility to set a value for the @Http-Annotations - what's the meaning of @HttpPost(HttpMethod.GET)? I think we should map the Annotation and HttpMethod in the Interceptor not in the Annotation itself Implement HttpInterceptor - Key: WW-4404 URL: https://issues.apache.org/jira/browse/WW-4404 Project: Struts 2 Issue Type: Improvement Components: Core Interceptors Affects Versions: 2.3.20 Reporter: Lukasz Lenart Priority: Minor Fix For: 2.5 Allows limit access to actions based on used Http method type https://github.com/apache/struts/pull/25 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Comment Edited] (WW-4404) Implement HttpInterceptor
[ https://issues.apache.org/jira/browse/WW-4404?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14227523#comment-14227523 ] Michael Hintenaus edited comment on WW-4404 at 11/27/14 11:13 AM: -- I have some notes: HttpMethodInterceptor#HTTP_METHOD_ANNOTATIONS doesn't contain HttpPut and HttpDelete HttpMethodInterceptor#intercept checks invocation.getProxy().isMethodSpecified() which means a normal action-method won't be checked because it's not method-specific. For example it's method-specific if we send a parameter method:cancel but that's not the default-way. First we have to check the method of the proxy, then the action-method of the proxy and at least the action-class why we have the possibility to set a value for the @Http-Annotations - what's the meaning of @HttpPost(HttpMethod.GET)? I think we should map the Annotation and HttpMethod in the Interceptor not in the Annotation itself was (Author: michael hintenaus): I have some notes: HttpMethodInterceptor#HTTP_METHOD_ANNOTATIONS doesn't contain HttpPut and HttpDelete HttpMethodInterceptor#intercept checks invocation.getProxy().isMethodSpecified() which means a normal action-method won't be checked because it's not method-specific. For example it's method-specific if a sent parameter method:cancel but that's not the default-way. First we have to check the method of the proxy, then the action-method of the proxy and at least the action-class why we have the possibility to set a value for the @Http-Annotations - what's the meaning of @HttpPost(HttpMethod.GET)? I think we should map the Annotation and HttpMethod in the Interceptor not in the Annotation itself Implement HttpInterceptor - Key: WW-4404 URL: https://issues.apache.org/jira/browse/WW-4404 Project: Struts 2 Issue Type: Improvement Components: Core Interceptors Affects Versions: 2.3.20 Reporter: Lukasz Lenart Priority: Minor Fix For: 2.5 Allows limit access to actions based on used Http method type https://github.com/apache/struts/pull/25 -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (WW-4333) ExcludedPatterns.CLASS_ACCESS_PATTERN is too restrictive
[ https://issues.apache.org/jira/browse/WW-4333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14055928#comment-14055928 ] Michael Hintenaus commented on WW-4333: --- At the first view I think your solution is ok, my test cases are passing. ExcludedPatterns.CLASS_ACCESS_PATTERN is too restrictive Key: WW-4333 URL: https://issues.apache.org/jira/browse/WW-4333 Project: Struts 2 Issue Type: Bug Affects Versions: 2.3.16.2 Reporter: Michael Hintenaus Priority: Critical Fix For: 2.3.18 it's not possible to set values on nested properties if the parent property ends with class, for example firstClass.value -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (WW-4332) refine excludeParams of ParametersInterceptor to improve security
[ https://issues.apache.org/jira/browse/WW-4332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13980775#comment-13980775 ] Michael Hintenaus commented on WW-4332: --- it's not possible to set something like this: model.testClass.myValue i think the regex should be (.*\.|^|.*\[['])[class(\.|[']\]|\[).* instead of (.*\.|^|.*|\[('|\))class(\.|('|\)]|\[).* refine excludeParams of ParametersInterceptor to improve security -- Key: WW-4332 URL: https://issues.apache.org/jira/browse/WW-4332 Project: Struts 2 Issue Type: Improvement Components: Core Interceptors Affects Versions: 2.3.16.1 Reporter: zhouyanming Assignee: Lukasz Lenart Priority: Critical Fix For: 2.3.16.2 {code} (.*\.|^)class\..* {code} should be {code} (.*\.|^)class(\.|\[).*,.*\['class'\](\.|\[).*,.*\[class\](\.|\[).* {code} it will block such as {code}class['classLoader'] , model['class'].classLoader , model[class].classLoader {code} I think use regex to block parameterName is not best solution,It must be done in ValueStack, seperate entry point , one for serverside, one for client side,client side should add more restriction and security checks. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (WW-4332) refine excludeParams of ParametersInterceptor to improve security
[ https://issues.apache.org/jira/browse/WW-4332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13980780#comment-13980780 ] Michael Hintenaus commented on WW-4332: --- sorry for the bad format in my last comment - once again it's not possible to set something like this: model.testClass.myValue i think the regex should be {code:java} (.*\\.|^|.*\\[['\])class(\\.|['\]\\]|\\[).* {code} instead of {code:java} (.*\\.|^|.*|\\[('|\))class(\\.|('|\)]|\\[).* {code} refine excludeParams of ParametersInterceptor to improve security -- Key: WW-4332 URL: https://issues.apache.org/jira/browse/WW-4332 Project: Struts 2 Issue Type: Improvement Components: Core Interceptors Affects Versions: 2.3.16.1 Reporter: zhouyanming Assignee: Lukasz Lenart Priority: Critical Fix For: 2.3.16.2 {code} (.*\.|^)class\..* {code} should be {code} (.*\.|^)class(\.|\[).*,.*\['class'\](\.|\[).*,.*\[class\](\.|\[).* {code} it will block such as {code}class['classLoader'] , model['class'].classLoader , model[class].classLoader {code} I think use regex to block parameterName is not best solution,It must be done in ValueStack, seperate entry point , one for serverside, one for client side,client side should add more restriction and security checks. -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Created] (WW-4333) ExcludedPatterns.CLASS_ACCESS_PATTERN is too restrictive
Michael Hintenaus created WW-4333: - Summary: ExcludedPatterns.CLASS_ACCESS_PATTERN is too restrictive Key: WW-4333 URL: https://issues.apache.org/jira/browse/WW-4333 Project: Struts 2 Issue Type: Bug Affects Versions: 2.3.16.2 Reporter: Michael Hintenaus Priority: Critical it's not possible to set values on nested properties if the parent property ends with class, for example firstClass.value -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (WW-4333) ExcludedPatterns.CLASS_ACCESS_PATTERN is too restrictive
[ https://issues.apache.org/jira/browse/WW-4333?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13980806#comment-13980806 ] Michael Hintenaus commented on WW-4333: --- looking at the first part of the current regex {code:java} (.*\\.|^|.*|\\[('|\)) {code} the third opinion is .* which will match anything, so if this is intended the regex could be simplified. But I believe you wanted to match .*[... so the last pipe of the subregex would be wrong. I would suggest the following regex (removed pipe and use range instead of group) {code:java} (.*\\.|^|.*\\[['\])class(\\.|['\]\\]|\\[).* {code} ExcludedPatterns.CLASS_ACCESS_PATTERN is too restrictive Key: WW-4333 URL: https://issues.apache.org/jira/browse/WW-4333 Project: Struts 2 Issue Type: Bug Affects Versions: 2.3.16.2 Reporter: Michael Hintenaus Priority: Critical Fix For: 2.3.18 it's not possible to set values on nested properties if the parent property ends with class, for example firstClass.value -- This message was sent by Atlassian JIRA (v6.2#6252)