You haven't answered my first question: ;-)

If you enter a date through your database console and then view the
record in your browser - what date format does it use? If you don't
modify the date, does it allow you to save it?

Matt

On 2/14/07, Fan <[EMAIL PROTECTED]> wrote:

This is the Person.java I have:

package org.appfuse.model;

import org.appfuse.model.BaseObject;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import javax.persistence.*;

@Entity(name="person")
public class Person extends BaseObject {
    private Long id;
    private String firstName;
    private String lastName;
    private java.util.Date dob;

        /**
         * @return the firstName
         */
    @Column(name="first_name", length=50)
        public String getFirstName() {
                return firstName;
        }
        /**
         * @param firstName the firstName to set
         */
        public void setFirstName(String firstName) {
                this.firstName = firstName;
        }

        /**
         * @return the id
         */
        @Id @GeneratedValue(strategy = GenerationType.AUTO)
        public Long getId() {
                return id;
        }
        /**
         * @param id the id to set
         */
        public void setId(Long id) {
                this.id = id;
        }

        /**
         * @return the lastName
         */
        @Column(name="last_name", length=50)
        public String getLastName() {
                return lastName;
        }
        /**
         * @param lastName the lastName to set
         */
        public void setLastName(String lastName) {
                this.lastName = lastName;
        }

        /**
         * @return the dob
         */

        @Column(name="dob")
        public java.util.Date getDob() {
                return dob;
        }

        /**
         * @param dob the dob to set
         */
        public void setDob(java.util.Date dob) {
                this.dob = dob;
        }


        /**
         * @see java.lang.Object#equals(Object)
         */
        public boolean equals(Object object) {
                if (!(object instanceof Person)) {
                        return false;
                }
                Person rhs = (Person) object;
                return new EqualsBuilder().append(this.firstName, rhs.firstName)
                                .append(this.id, rhs.id).append(this.lastName, 
rhs.lastName)
                                .isEquals();
        }
        /**
         * @see java.lang.Object#hashCode()
         */
        public int hashCode() {
                return new HashCodeBuilder(1160340241, -525786491).append(
                                
this.firstName).append(this.id).append(this.lastName)
                                .toHashCode();
        }
        /**
         * @see java.lang.Object#toString()
         */
        public String toString() {
                return new ToStringBuilder(this, 
ToStringStyle.DEFAULT_STYLE).append(
                                "lastName", this.lastName).append("id", 
this.id).append(
                                "firstName", this.firstName).toString();
        }
}




Matt Raible-3 wrote:
>
> If you enter a date through your database console and then view the
> record in your browser - what date format does it use? If you don't
> modify the date, does it allow you to save it?
>
> Are you sure you're using java.util.Date?
>
> Matt
>
> On 2/13/07, Fan <[EMAIL PROTECTED]> wrote:
>>
>> I was trying the suggestions you provided. Unfortunately, neither of them
>> works
>>
>> by the way, I am using Struts2 basic
>>
>>
>>
>> Matt Raible-3 wrote:
>> >
>> > If you remove the Scriptaculous and Prototype includes from the
>> > default.jsp decorator - does that help?  As far as the date error -
>> > what happens if you use something like 05-07-1976?
>> >
>> > Matt
>> >
>> > On 2/12/07, Fan <[EMAIL PROTECTED]> wrote:
>> >>
>> >> I am using the following in personForm.jsp :
>> >>
>> >> <s:datepicker label="%{getText('person.dob')}"  name="person.dob"
>> >>          format="#yyyy-#MM-#dd"/>
>> >>
>> >> However , I cant get any Calendar component from the screen.
>> >>
>> >> when I tried to save the field with "1976-05-07", it showed the
>> following
>> >> message :
>> >>
>> >> Validation Error Invalid field value for field "person.dob".
>> >>
>> >>
>> >>
>> >> Matt Raible-3 wrote:
>> >> >
>> >> > You might try using the <s:datepicker> component.
>> >> >
>> >> >
>> >>
>> 
http://struts.apache.org/2.x/core-apidocs/org/apache/struts2/components/DatePicker.html
>> >> >
>> >> > Matt
>> >> >
>> >> > On 2/7/07, Fan <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >> I am using struts 2
>> >> >>
>> >> >>
>> >> >> Matt Raible-3 wrote:
>> >> >> >
>> >> >> > On 2/7/07, Fan <[EMAIL PROTECTED]> wrote:
>> >> >> >>
>> >> >> >>
>> >> >> >> 1)Is there any Calendar component in Appfuse 2.0, if there is
>> so,
>> >> how
>> >> >> >> could I
>> >> >> >> make use of it ?
>> >> >> >
>> >> >> >
>> >> >> > Which web framework are you using?
>> >> >> >
>> >> >> > 2)How do we define date field (without time)  in POJO for Appfuse
>> >> 2.0 ?
>> >> >> >
>> >> >> >
>> >> >> > as a java.util.Date
>> >> >> >
>> >> >> > Matt
>> >> >> >
>> >> >> > --
>> >> >> >> View this message in context:
>> >> >> >>
>> >> >>
>> >>
>> 
http://www.nabble.com/Calendar-component-and-Date-field-for-Appfuse-2.0-tf3187463s2369.html#a8846844
>> >> >> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>> >> >> >>
>> >> >> >>
>> >> ---------------------------------------------------------------------
>> >> >> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> >> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >> >>
>> >> >> >>
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > http://raibledesigns.com
>> >> >> >
>> >> >> >
>> >> >>
>> >> >> --
>> >> >> View this message in context:
>> >> >>
>> >>
>> 
http://www.nabble.com/Calendar-component-and-Date-field-for-Appfuse-2.0-tf3187463s2369.html#a8858069
>> >> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > http://raibledesigns.com
>> >> >
>> >> >
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> 
http://www.nabble.com/Calendar-component-and-Date-field-for-Appfuse-2.0-tf3187463s2369.html#a8925497
>> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>> > --
>> > http://raibledesigns.com
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> 
http://www.nabble.com/Calendar-component-and-Date-field-for-Appfuse-2.0-tf3187463s2369.html#a8945398
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>
> --
> http://raibledesigns.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
View this message in context: 
http://www.nabble.com/Calendar-component-and-Date-field-for-Appfuse-2.0-tf3187463s2369.html#a8966008
Sent from the AppFuse - User mailing list archive at Nabble.com.

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




--
http://raibledesigns.com

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

Reply via email to