I have a <h:inputText> which accepts a long value like this
<h:inputText value="#{ServiceTable.ID}" />
The property is declared like this
public class ServiceTable {
private long ID;
// Getter and setter for ID.
}
When I open the page, I always see 0 in the textbox. How can I avoid it? I just need an empty textbox. I am using JSF 1.2.
Use
Longinstead oflong. It defaults tonull.And, if you’re running Tomcat 6.0.16 or newer or a fork of it, then you need to add the following VM argument to server startup arguments as well to disable EL coercion of primitives and their wrappers: