0

I am using JSF2.1.13,Primefaces5.3,Jboss7.1 OR Jboss6.3 EAP for my web-application and i am using diffrent-2 input component for taking input from user but all the input component showing 0 when page loaded also when i am submitting form this default zero value show to datatlist as well.

Now when i google it plenty of question and answer i got about this issue

  1. Integer getting default value 0 where it required to be NULL in Java
  2. In jsf how integer properties get value 0 in client page without process validation phase for first time request
  3. jsf: integer property binded to a inputtext in UI is set to zero on submit

But this all solution work well with Tomcat. While i am using Jboss its not working .Next thing no any exact solution we have even after using the latest JSF jars?

Edit:-

public class EquipAssociations implements Serializable  
  private Integer minCardinality;
  private Integer maxCardinality;
}

and value binding code

<p:spinner id="maxCardId" value="#{equipTemplateBean.equipmentAssnObj.maxCardinality}" min="1"  />

EDIT1:-

Changes in web.xml file

    <context-param>
    <param-name>javax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL</param-name>
    <param-value>true</param-value>
    </context-param>
Community
  • 1
  • 1
Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
  • Please provide version info. Very relevant. JSF 2.2 is not an impl version it is an api version. And JBoss 3.0 is not supported anymore. And please check http://balusc.omnifaces.org/2015/10/the-empty-string-madness.html – Kukeltje Nov 13 '15 at 09:24
  • Edited question with version number – Subodh Joshi Nov 13 '15 at 09:28
  • hmmm from jsf 2.2 to jsf 2.1.13... Mojarra 2.1.13 I assume? – Kukeltje Nov 13 '15 at 09:35
  • And to maybe exclude the obvious: You are sure you are using an Integer and not an int? (no code posted to 'prove' that) – Kukeltje Nov 13 '15 at 09:44
  • The getter also returns Integer and not int? – Kukeltje Nov 13 '15 at 09:57
  • You forgot to tell how exactly you have set the system property. You have nowhere explicitly told that, leaving us with the impression that you actually didn't set it. The blog Kukeltje linked to also shows a programmatic way how to set it. – BalusC Nov 13 '15 at 10:10
  • @BalusC Do you mean by web.xml changes? – Subodh Joshi Nov 13 '15 at 10:17
  • Every answer you found tells to set COERCE_TO_ZERO. Are you saying that you didn't do that? – BalusC Nov 13 '15 at 10:19
  • @BalusC ` Will this Solution work for Jboss as well ? -Dorg.apache.el.parser.COERCE_TO_ZERO=false` .Also in production server also we have to make changes for this ? Which is generally not in the control of developers. – Subodh Joshi Nov 13 '15 at 10:26
  • 1
    So you didn't know that JBoss is using Tomcat as servlet container? And you missed that Kukeltje linked a blog which also shows how to solve it on JBoss? And you missed that I told that there's a programmatic way to set it? What's happening with your reading skills? – BalusC Nov 13 '15 at 10:27

0 Answers0