> I have a Date variable in a JavaBean that works with a Oracle
> Database.
[quoted text clipped - 3 lines]
> the JSP.
> How do I account for null with a Date object?
Test the reference for "== null".
> If there is not Date value I still want the page to show the Date
> Title with nothing there.
[quoted text clipped - 5 lines]
> but it doesnt show and gives me a null error:
> Submit Date:
Well, what do you expect when you attempt to format a null value?
> My classes and JSP:
>
[quoted text clipped - 5 lines]
> SimpleDateFormat formatter = new SimpleDateFormat ("MMMM dd,
> yyyy");
You could set 'formatter' as a static final variable, since you never change it.
> return formatter.format(this.subDate);
> }
[quoted text clipped - 4 lines]
> public String getSubDate(){
> if((subDate == null)
This won't even compile. Are you sure this is what your code was?
> {
> subDate = null;
OK, having ascertained via the 'if' that 'subDate' is null, you then
redundantly set it to null yet again, accomplishing no change.
> }
> SimpleDateFormat formatter = new SimpleDateFormat ("MMMM dd,
> yyyy");
> return formatter.format(this.subDate);
It seems that you can't format a null date. Just return "" if 'subDate == null'.
> }
>
[quoted text clipped - 15 lines]
> Submit Date: <jsp:getProperty name="projectObject"
> property="subDate" />
If you use Expression Language (EL), it does the right thing with null values.
Submit Date: <c:out value="${subDate}" />
However, SimpleDateFormat will still blow up on the null reference.

Signature
Lew