struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4663) NullPointerException when displaying a form without action attribute
Date Tue, 04 Apr 2017 07:52:41 GMT

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

Hudson commented on WW-4663:
----------------------------

SUCCESS: Integrated in Jenkins build Struts-JDK7-master #615 (See [https://builds.apache.org/job/Struts-JDK7-master/615/])
WW-4663 Fallback to old behaviour if there is no action defined (lukaszlenart: rev 1162ddf823b9d47df080fd273f1da22e088eda72)
* (edit) core/src/main/java/org/apache/struts2/components/Form.java


> NullPointerException when displaying a form without action attribute
> --------------------------------------------------------------------
>
>                 Key: WW-4663
>                 URL: https://issues.apache.org/jira/browse/WW-4663
>             Project: Struts 2
>          Issue Type: Bug
>    Affects Versions: 2.3.28, 2.3.29, 2.3.30
>            Reporter: Yan Soulliaert
>            Assignee: Lukasz Lenart
>             Fix For: 2.5.next
>
>
> Hello,
> I'm currently trying to upgrade Struts from V2.3.20 to V2.3.30.
> Starting from V2.3.28, I'm having a yellow FreeMarker stack at the end of some pages.
These pages have a <s:form> tag without "action" attribute.
> Here is some part of the displayed error :
> {noformat}
> Java method "org.apache.struts2.components.Form.getValidators(String)" threw an exception
when invoked on org.apache.struts2.components.Form object "org.apache.struts2.components.Form@3d354929";
see cause exception in the Java stack trace.
> FTL stack trace ("~" means nesting-related):
> 	- Failed at: #list tag.getValidators("\$\{tagName\}"...  [in template "template/~~~css_xhtml/form-close-validate.ftl"
at line 66, column 9]
> 	- Reached through: #include "/\$\{parameters.templateDir\}...  [in template "template/xhtml/form-close.ftl"
at line 25, column 1]
> ...
> Caused by: java.lang.NullPointerException
> 	at org.apache.struts2.util.ComponentUtils.containsExpression(ComponentUtils.java:51)
> 	at org.apache.struts2.components.Component.findValue(Component.java:376)
> 	at org.apache.struts2.components.Component.findString(Component.java:226)
> 	at org.apache.struts2.components.Form.getValidators(Form.java:276)
> {noformat}
> Here are the results of my research :
> - When the method  org.apache.struts2.components.Form.getValidators(String name) is called
at the end of the page display, the "action" var is null.
> - findString(action) is called, leading to org.apache.struts2.components.Component.findValue(String
expr, Class toType) with expr=null
> - Starting from V2.3.28,  a new condition has been added to this method : if (ComponentUtils.containsExpression(expr)).
This raises the NPE.
> Is this a bug, or am I doing something wrong ?
> Thanks in advance,
> Yan



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message