myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Spencer <pau...@apache.org>
Subject Getting NPE when flowscope value evaluates to null.
Date Fri, 04 Jul 2014 04:08:12 GMT
MyFaces 2.2.3 &  2.2.4
jetty-maven-plugin:8.1.15.v20140411

Getting NPE when Flow Scope parameter evaluates to null.

If no value is entered for firstName before “continue” on  campaigns/campaigns.xhtml is
clicked, the NPE below thrown. Otherwise the page2.xhtml is displayed as expected.

***
* campaigns/campaigns.xhtml
***
	<h:outputLabel for="firstName" value="First Name" />
	<h:inputText id="firstName" value="#{flowScope.firstName}" maxlength="10" />
	<h:commandButton value=“Continue” action=“page2” />

***
* campaigns/page2.xhtml
***
	<h:commandButton value=“Exit" action="campaigns-return" />
	<h:outputLabel for="firstName" value="First Name" />
	<h:inputText id=“firstName" value="#{flowScope.firstName}" maxlength="10" />

***
* Error displayed when page2.xhtml is returned and firstName is null
***
> java.lang.NullPointerException
> 
> viewId=/campaigns/campaigns.xhtml
> location=/Users/paul/Documents/workspace-4.3.2/VenderRollsImporterMockUp/src/main/webapp/campaigns/campaigns.xhtml
> phaseId=UPDATE_MODEL_VALUES(4)
> 
> Caused by:
> java.lang.NullPointerException - java.lang.NullPointerException
> at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1124)
> <HtmlInputText class="class javax.faces.component.html.HtmlInputText” clientId="j_id_s:firstName"
disabled="false" id="firstName" immediate="false" inView="true" localValueSet="true" maxlength="10"
readonly="false" rendered="true" required="false" size="-2147483648" transient="false" valid="false"
value="#{flowScope.firstName}" location="/campaigns/campaigns.xhtml at line 76 and column
82"/> - State size:246 bytes

***
* Scopes Value
***
> Request Parameters
> Name	Value
> j_id_s:firstName	
> j_id_s:j_id_x	Continue
> j_id_s_SUBMIT	1
> jfwid	-lbh0f813a


Is this normal?

Paul Spencer
Mime
View raw message