문제

I am rendering a date field in XHTML using JSF. Since the value in DB is saved as null the date field values is shown as "null" in the UI. How to avoid this null?

My code is given below:

    <h:outputFormat value="{0, date, MM/dd/yyyy}"
                                        rendered="#{sysbean.xx.isfeed == '1' or (sysbean.yy== false and sysbean.details.endate!= null)}">
<f:param value="#{sysbean.details.endate}" /></h:outputFormat> 

The output I am getting is

Project Name : null

How can I avoid the value coming as "null"?

도움이 되었습니까?

해결책

<f:param value="#{value to check!=null?value when condition is true:
value when condition is false}" />

Checking the null at EL expression, or in the bean also you can put the inline check for null values.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top