This is happening because when you click submit and go to validate(...) in
your form class a new form is created and populated with the request
parameters from the JSP page.  So if you don't have postDate as a hidden
field or put the form in session the value will be lost.  Ted posted a
message on this topic not too long ago about how to handle this situation.

Kimberly MacKellar

-----Original Message-----
From: Siggelkow, Bill [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 9:16 AM
To: 'Struts Users Mailing List'
Subject: RE: Problem with bean:define?


Well, I did a test and bean:write displays the date the first time thru, but
then displays nothing when I return to the page to display validation
errors?  Why would this value be getting cleared in my form?  I null out all
my fields in the reset method including this 'postDate' property.  Any
ideas?   

-----Original Message-----
From: Keith Bacon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 7:15 AM
To: Struts Users Mailing List
Subject: RE: Problem with bean:define?


are you saying your jsp is getting null pointer excp
in setAttribute() in the <bean:define tag?

does this work?
<bean:write name="editRegForm" property="postDate" />


Keith. (not much use I suspect - try my best!).

--- "Siggelkow, Bill" <[EMAIL PROTECTED]>
wrote:
> Specifically, I am trying to use the define tag to
> define a variable based
> on a property of the FormBean as follows: (the
> getLocalDate is my own tag
> for rendering dates.
> 
> <bean:define id="postDate" name="editRegForm"
> property="postDate"
> type="java.util.Date"/>
> <mir:getLocalDate date="<%=postDate%>"
> style="long"/>
> 
> -----Original Message-----
> From: Siggelkow, Bill
> [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 18, 2001 11:33 AM
> To: '[EMAIL PROTECTED]'
> Subject: Problem with bean:define?
> 
> 
> I am using the bean:define tag to make a variable
> available ... he's the
> wierd part ... it works the "first time" I enter the
> form ... but if I
> return to the form because of a validation error ...
> it fails with a
> NullPointerException in the pageContext.setAttribute
> method ... it seems to
> me the second time around it is not finding the
> value for some reason ...
> any ideas?
> 
> Bill Siggelkow
> eBusiness Lead Developer
> 678.579.6458
> Mirant
> http://www.mirant.com
> 
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
Check out Yahoo! Shopping and Yahoo! Auctions for all of
your unique holiday gifts! Buy at http://shopping.yahoo.com
or bid at http://auctions.yahoo.com

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to