aspose file tools
The moose likes JSF and the fly likes Exception when using JSF backing bean property as integer Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSF
Reply Bookmark "Exception when using JSF backing bean property as integer" Watch "Exception when using JSF backing bean property as integer" New topic
Author

Exception when using JSF backing bean property as integer

Maya Pillai
Ranch Hand

Joined: Jul 17, 2008
Posts: 60
I am getting an exception (exception while getting property userAge) when using the backing bean property as Integer.....It is working fine when i change the property to String.

Backing Bean
-----------------------------
Private Integer userAge;

setter and getter

JSF
--------
<h:inputText class="txtNormal" id="userAge" value="#{nominationFormOneBean.userAge}" />

Can anyone help me to solve this.
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
I think you need to use a JSF converter. Here's a link to a tutorial on JSF converters: http://www.laliluna.de/articles/javaserver-faces-converter-tutorial.html
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14561
    
    7

Actually, simple conversions in JSF EL are normally handled automatically by the BeanUtils subsystem. It would have helped to also show the source code for the propery's setter and getter method.

Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Exception when using JSF backing bean property as integer
 
Similar Threads
jsp:setProperty param
select the chekbox generated at runtime of jsf page using javascript
Which Binding Type Do You Prefer And Why
value and binding attribute
Avoiding Default primitive wrapper value display on JSF page