InputText associated with the null double cast presence of "0.0",

Is there any way to prevent this without creating a new converter?

<p:inputText value="#{myMB.myDouble}" />

@ManagedBean
@SessionScoped
public class MyMB
    private Double myDouble = null;
....

When I enter the view, I want to see an empty input field, not "0.0".

+3
source share
1 answer

This can happen if you use Tomcat 6.0.16 or later or its plug using the same Apache EL parser as JBoss AS and WebSphere AS. You basically need to tell the Apache EL parser that it does not force primitives to their default values ​​with the following VM argument, which is supported with Tomcat 6.0.17:

-Dorg.apache.el.parser.COERCE_TO_ZERO=false

This issue is not related to JSF. For example, this does not happen on Glassfish.

+4
source

All Articles