[
https://issues.apache.org/jira/browse/WW-4921?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16378409#comment-16378409
]
ASF subversion and git services commented on WW-4921:
-----------------------------------------------------
Commit 54fa3f7b0474f415575e7416b43f3bf7f241a13a in struts's branch
refs/heads/master from Lukasz Lenart
[ https://gitbox.apache.org/repos/asf?p=struts.git;h=54fa3f7 ]
Merge pull request #214 from yasserzamani/WW-4921
WW-4921 initialize session like WW-3442
> 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
> Assignee: Yasser Zamani
> 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)