java.sql.Timestamp is a subclass of java.util.Date so it should be accepted
by your method. It is probably used as it adds a nanoseconds field to the
data and is database friendly.

Spring should give you a binding error with more detail in it, more than
likely related to validation. Could you post the details of the error? We
may then be able to help you. Some additonal details would also be useful:
what kind of test are you running? I assume it is a controller unit test?
Please also check your sample data carefully - it may be failing validation
when passed back through the controller.

Mike.

On 7/9/07, Msarda <[EMAIL PROTECTED]> wrote:


Hello,
While debuging the test case method,when it was entering in
handleRequestInternal() method of AbstractformController at the line,

Object command = getCommand(request);

In the command object i was getting priorityDate as Timestamp instead of
getting java.util.Date.
I think this may be the resaon while test case is getting failed,because i
have type of priorityDate in model object as java.util.date.
But i not getting why it is Timestamp and not Date. :(


Msarda wrote:
>
> Hello Mike,
>
> Right now i am not in the office so can't get more details about that
> error.
> But i think it may be wrong format of priorityDate data in
> sample-data.xml,that was generated by default.
> I tried giving different formats,but still problem was not resolved,was
> getting casting error.
> .
> But when i was putting <null/> for data in priorityDate column in
> sample-data.xml file,i was getting casting error for other columns,for
> which i never got any error before and the data for those columns was
also
> correct.
>
> One more thing is when i was commenting the line of test where i was
> getting error aand running the application and entering wrong data for
> priorityDate(only 12) it was giving error message as "can not convert
from
> String to required type java.utilDate but not user freindly error
message.
> When i put something like 122/2344/121323,it was giving proper error
> message.
> I don't understand why like this. :(
>
> Thanks for your kind help.
>
>
> Michael Horwitz wrote:
>>
>> Do you have some detail on the binding error being thrown?
>>
>> Mike
>>
>> On 7/9/07, Msarda <[EMAIL PROTECTED]> wrote:
>>>
>>>
>>> Thanks for reply.
>>>
>>> Tried that also,but still same problem.
>>> I am getting data binding error,debuging that test case.
>>>
>>> TryEngagementForm1] INFO [main]
>>> EngagementformFormControllerTest.startNewTransaction(323) | Began
>>> transaction (1): transaction manager
>>> [EMAIL PROTECTED]
];
>>> default rollback = true
>>> [TryEngagementForm1] DEBUG [main]
>>> EngagementformFormController.processFormSubmission(256) | Data binding
>>> errors: 1
>>> [TryEngagementForm1] INFO [main]
>>> EngagementformFormControllerTest.endTransaction(290) | Rolled back
>>> transaction after test execution
>>>
>>>
>>> fadhlirahim wrote:
>>> >
>>> > Hello,
>>> >
>>> > For date values, date values should looks like this...
>>> > <![CDATA[2007-06-15]]>
>>> >
>>> > On 7/9/07, Msarda <[EMAIL PROTECTED]> wrote:
>>> >>
>>> >>
>>> >> Thanks Mike for your reply.
>>> >>
>>> >> My application in running now.
>>> >>
>>> >> But still i have one problem regarding validation.
>>> >> I have priorityDate field in my model object.When i am putting
>>> validation
>>> >> for that field in validation.xml,my test caes are getting
>>> >> failed(testRemove() method)
>>> >>
>>> >> I tried changing date pattern for data for that column in
>>> sample-data.xml
>>> >> file also,but not successful.
>>> >> In validation.xml i have done following...
>>> >>
>>> >> <field property="priorityDate" depends="date">
>>> >>                 <arg0 key="engagementform.priorityDate"/>
>>> >>             </field>
>>> >>
>>> >> in sample-data.xml i have sample data for priorityDate as...
>>> >>
>>> >> <value description="priorityDate">2007-04-04</value>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> Michael Horwitz wrote:
>>> >> >
>>> >> > Hi,
>>> >> >
>>> >> > Just answered a similar question on another thread which I think
>>> may
>>> >> help
>>> >> > here too. As long as you are using a version of AppFuse which
uses
>>> >> Spring
>>> >> > 2.0.x you should be using the Spring form tags to do all the hard
>>> work
>>> >> for
>>> >> > you (I have adjusted the stuff below to match your JSP). I also
>>> notice
>>> >> you
>>> >> > seem to have a form specific backing object - as a rule I try and
>>> >> design
>>> >> > my
>>> >> > systems to edit the model objects directly. Spring does most of
the
>>> >> work,
>>> >> > and it leads to a dramatic reduction in code.
>>> >> >
>>> >> > From other thread (edited):
>>> >> >
>>> >> >  Hmm. In that case you might want to take a look at Spring's form
>>> tags
>>> >> to
>>> >> > make life a little easier:
>>> >> >
>>> >>
>>>
http://static.springframework.org/spring/docs/2.0.x/reference/spring-form.tld.html
>>> >> >
>>> >> >
>>> >> > So your JSP would look something like:
>>> >> >
>>> >> > <spring:form commandName="engagementform" ...>
>>> >> >
>>> >> > ...
>>> >> >
>>> >> > <spring:select path="systems"  items="${webSystemImpacted}"
>>> >> > itemLabel="name" itemValue="id"/>
>>> >> > ....
>>> >> >
>>> >> > </spring:form>
>>> >> >
>>> >> > A lot simpler and Spring will do all the hard work for you. It
>>> should
>>> >> all
>>> >> > just work like magic. I think the problem in your code is the
name
>>> you
>>> >> > attach to the select element - Spring expects specific names to
get
>>> its
>>> >> > bindings sorted out.
>>> >> >
>>> >> > Mike.
>>> >> >
>>> >> >
>>> >> >
>>> >> > On 7/6/07, Michael Horwitz <[EMAIL PROTECTED]> wrote:
>>> >> >>
>>> >> >> Which version of AppFuse are you using?
>>> >> >>
>>> >> >>
>>> >> >>  On 7/6/07, Msarda <[EMAIL PROTECTED]> wrote:
>>> >> >> >
>>> >> >> >
>>> >> >> > I tried populating "webSystemImpacted" in
>>> >> EngagementformFormController
>>> >> >> > in
>>> >> >> > following method ,but i am getting jasper exception.
>>> >> >> >
>>> >> >> > protected Map referenceData(HttpServletRequest request) throws
>>> >> >> Exception
>>> >> >> > {
>>> >> >> >
>>> >> >> >        Map model = new HashMap();
>>> >> >> >
>>> >> >> >        model.put("webSystemImpacted",
webappssystemManager.getAll
>>> ());
>>> >> >> >
>>> >> >> >        model.put("areas",areasimpactedManager.getAll());
>>> >> >> >
>>> >> >> >        return model;
>>> >> >> >
>>> >> >> >    }
>>> >> >> >
>>> >> >> >
>>> >> >> > Msarda wrote:
>>> >> >> > >
>>> >> >> > > Thanks Mike.
>>> >> >> > > It's working now after using property editor class.
>>> >> >> > > But still  there is one problem.I am not able to populate
the
>>> list
>>> >> of
>>> >> >> > > areas and webSystemImpacted in  the jsp.
>>> >> >> > > In the engagementformform.jsp i am doing like this...
>>> >> >> > >
>>> >> >> > > <appfuse:label styleClass="desc" key="
>>> engagementform.systems"/>
>>> >> >> > >     <spring:bind path="engagementform.systems">
>>> >> >> > >                       <SELECT name="system">
>>> >> >> > >                           <c:forEach var="sys"
>>> >> >> > > items="${webSystemImpacted}">
>>> >> >> > >                               <OPTION value='<c:out
>>> >> value="${sys.id
>>> >> }"
>>> >> >> > />'
>>> >> >> > > <c:if test="${engagementform.systems.id==sys.id
>>> >> }">SELECTED</c:if>>
>>> >> >> > >                               <c:out value="${sys.name}"/>
>>> >> </OPTION>
>>> >> >> > >                           </c:forEach>
>>> >> >> > >                       </SELECT>
>>> >> >> > >     </spring:bind>
>>> >> >> > >
>>> >> >> > > And in onSubmit() method of EngagementformController.java i
am
>>> >> doing
>>> >> >> > > like...
>>> >> >> > >
>>> >> >> > >   ModelAndView modelview = new ModelAndView(success);
>>> >> >> > >
>>> >> >> > >
>>> >> modelview.addObject("webSystemImpacted",webappssystemManager.getAll
>>> >> >> > ());
>>> >> >> > >
>>> >> modelview.addObject("areas",areasimpactedManager.getAll());
>>> >> >> > >         return modelview;
>>> >> >> > >
>>> >> >> > > When i am calling engagementformform.jsp for editing
>>> >> record  the  the
>>> >> >> > flow
>>> >> >> > > goes to formBackingObject method of
>>> >> EngagementformController.javanot
>>> >> >> > the
>>> >> >> > > onSubmit(),but i am not getting how will i populate
>>> >> >> > > "webSystemImpacted" in formBAckingObject method
>>> >> >> > >
>>> >> >> > >
>>> >> >> > > Michael Horwitz wrote:
>>> >> >> > >>
>>> >> >> > >> Quoted from the thread mentioned:
>>> >> >> > >>
>>> >> >> > >> You are going to need to provide Spring MVC with a way to
get
>>> >> from
>>> >> >> an
>>> >> >> > id
>>> >> >> > >> to
>>> >> >> > >> a country and vice-versa.  As you correctly point out this
is
>>> >> done
>>> >> >> by
>>> >> >> > >> registering a custom property editor in your controller. To
>>> do
>>> >> this
>>> >> >> > you
>>> >> >> > >> need
>>> >> >> > >> to:
>>> >> >> > >>
>>> >> >> > >> 1) Extend the class PropertyEditorSupport to create the
>>> property
>>> >> >> > >> editor:
>>> >> >> > >>
>>> >> >>
>>> >>
>>>
http://java.sun.com/j2se/1.5.0/docs/api/java/beans/PropertyEditorSupport.html
>>> >> >> >
>>> >> >> > >>
>>> >> >> > >>
>>> >> >> > >> You need to override the getAsText() and setAsText()
methods.
>>> The
>>> >> >> > first
>>> >> >> > >> should call getValue() and return the id as text, and the
>>> second
>>> >> >> > should
>>> >> >> > >> accept a text id and call setValue() on the editor with the
>>> >> >> > corresponding
>>> >> >> > >> country object.
>>> >> >> > >>
>>> >> >> > >> 2) You then register this custom editor using one of the
>>> >> appropriate
>>> >> >> > >> methods
>>> >> >> > >> on your controller: initBinder() see api on
>>> >> >> http://tinyurl.com/2sutrm
>>> >> >> > >>
>>> >> >> > >> And it should all work like magic....
>>> >> >> > >>
>>> >> >> > >> Mike.
>>> >> >> > >>
>>> >> >> > >>
>>> >> >> > >> On 7/3/07, Msarda < [EMAIL PROTECTED]> wrote:
>>> >> >> > >>
>>> >> >> > >>>
>>> >> >> > >>> Thanks Mike for your reply.
>>> >> >> > >>>
>>> >> >> > >>> Actually i am not getting a clear idea about how to
>>> implement
>>> >> >> > >>> PropertyEditorSupport Class excatly in my form controller.
>>> >> >> > >>> It will be very helpful if u can explore about it a bit
>>> more.
>>> >> >> > >>>
>>> >> >> > >>>
>>> >> >> > >>> Michael Horwitz wrote:
>>> >> >> > >>> >
>>> >> >> > >>> > You need to register a custom editor inside your form
>>> >> controller
>>> >> >> > so
>>> >> >> > >>> that
>>> >> >> > >>> > Spring can convert your model object to/from text.
Please
>>> see
>>> >> >> this
>>> >> >> > >>> thread
>>> >> >> > >>> > for further details:
>>> >> >> > >>> >
>>> >> >> > >>> >
>>> >> >> > >>>
>>> >> >> >
>>> >> >>
>>> >>
>>>
http://www.nabble.com/Add-ManyToOne-relationship-between-user-and-a-new-pojo-tf3993393s2369.html
>>> >> >> > >>> >
>>> >> >> > >>> > Mike.
>>> >> >> > >>> >
>>> >> >> > >>> >
>>> >> >> > >>> > On 7/2/07, Msarda <[EMAIL PROTECTED]>
wrote:
>>> >> >> > >>> >>
>>> >> >> > >>> >>
>>> >> >> > >>> >> Hi,
>>> >> >> > >>> >>
>>> >> >> > >>> >> I have three model objects
>>> >> >> > >>> Engagementform,Areasimpacted,Webappssystem.
>>> >> >> > >>> >> I have many to many mapping in Engagementform &
>>> Areasimpacted
>>> >> >> > and
>>> >> >> > >>> >> Engagementform  & Webappssystem.
>>> >> >> > >>> >> I have used following  in Engagementform.java
>>> >> >> > >>> >> Set<Webappssystem> systems;
>>> >> >> > >>> >> Set<Areasimpacted> areasImpacted;
>>> >> >> > >>> >>
>>> >> >> > >>> >> I want to take the data for this two sets from the jsp
of
>>> >> >> > >>> Engagementform
>>> >> >> > >>> >> not
>>> >> >> > >>> >> from separate jsps generated by maven for these two
sets.
>>> >> >> > >>> >> I have customized the jsp for Engagementform  generated
>>> by
>>> >> >> > >>> appfuse/maven
>>> >> >> > >>> >> by
>>> >> >> > >>> >> adding <select/> tag for these two sets as
>>> >> >> > >>> >>
>>> >> >> > >>> >> <li>
>>> >> >> > >>> >>      <appfuse:label styleClass="desc"
>>> >> >> key="engagementform.systems
>>> >> >> > "/>
>>> >> >> > >>> >>      <spring:bind path="engagementform.systems ">
>>> >> >> > >>> >>      <select name="systems" multiple="true">
>>> >> >> > >>> >>      <option value="BPAYBiller">BPAY Biller </option>
>>> >> >> > >>> >>      <option value="DocumentGenerationSystem">Document
>>> >> >> Generation
>>> >> >> >
>>> >> >> > >>> >> System</option>
>>> >> >> > >>> >>      <option
>>> value="RelationshipPricingModel">Relationship
>>> >> >> > Pricing
>>> >> >> > >>> >> Model</option>
>>> >> >> > >>> >>      <option value="Business Banking">Business
>>> >> Banking</option>
>>> >> >> > >>> >>      <option value="BisTracker">BisTracker</option>
>>> >> >> > >>> >>      <option value="EventTracker">Event
Tracker</option>
>>> >> >> > >>> >>      <option value="Other:">Other:</option>
>>> >> >> > >>> >>     </select>
>>> >> >> > >>> >>    </spring:bind>
>>> >> >> > >>> >>    </li>
>>> >> >> > >>> >>
>>> >> >> > >>> >> But when i tried to select from the list and save the
>>> >> >> > >>> >> Engagementform  object
>>> >> >> > >>> >> i am getting error
>>> >> >> > >>> >>
>>> >> >> > >>> >> Failed to convert property value of type
>>> [java.lang.String
>>> []]
>>> >> to
>>> >> >> > >>> required
>>> >> >> > >>> >> type [java.util.Set] for property areasImpacted; nested
>>> >> >> exception
>>> >> >> > is
>>> >> >> > >>> >> java.lang.IllegalArgumentException: Cannot convert
value
>>> of
>>> >> type
>>> >> >> > >>> >> [java.lang.String ] to required type
>>> >> >> > >>> [au.com.suncorp.model.Areasimpacted
>>> >> >> > >>> ]
>>> >> >> > >>> >> for
>>> >> >> > >>> >> property areasImpacted[0]: no matching editors or
>>> conversion
>>> >> >> > strategy
>>> >> >> > >>> >> found
>>> >> >> > >>> >> Failed to convert property value of type
>>> [java.lang.String
>>> []]
>>> >> to
>>> >> >> > >>> required
>>> >> >> > >>> >> type [java.util.Set] for property systems; nested
>>> exception
>>> >> is
>>> >> >> > >>> >> java.lang.IllegalArgumentException: Cannot convert
value
>>> of
>>> >> type
>>> >> >> > >>> >> [java.lang.String] to required type
>>> >> >> > >>> [au.com.suncorp.model.Webappssystem
>>> >> >> > >>> ]
>>> >> >> > >>> >> for
>>> >> >> > >>> >> property systems[0]: no matching editors or conversion
>>> >> strategy
>>> >> >> > found
>>> >> >> > >>> >>
>>> >> >> > >>> >>
>>> >> >> > >>> >> I tried to change setter for these two properties
>>> manually
>>> >> but
>>> >> i
>>> >> >> > am
>>> >> >> > >>> >> getting
>>> >> >> > >>> >> test cases failure.
>>> >> >> > >>> >> can anybody please tell me what should i do....
>>> >> >> > >>> >>
>>> >> >> > >>> >> --
>>> >> >> > >>> >> View this message in context:
>>> >> >> > >>> >>
>>> >> >> > >>>
>>> >> >> >
>>> >> >>
>>> >>
>>>
http://www.nabble.com/Problem-with-ManyToMany-Mapping-tf4009715s2369.html#a11387191
>>> >> >> > >>> >> Sent from the AppFuse - User mailing list archive at
>>> >> >> Nabble.com<http://nabble.com/>
>>> >> >> > .
>>> >> >> > >>> >>
>>> >> >> > >>> >>
>>> >> >> >
>>> >>
---------------------------------------------------------------------
>>> >> >> > >>> >> To unsubscribe, e-mail:
>>> >> [EMAIL PROTECTED]
>>> >> >> > >>> >> For additional commands, e-mail:
>>> >> [EMAIL PROTECTED]
>>> >> >> > >>> >>
>>> >> >> > >>> >>
>>> >> >> > >>> >
>>> >> >> > >>> >
>>> >> >> > >>>
>>> >> >> > >>> --
>>> >> >> > >>> View this message in context:
>>> >> >> > >>>
>>> >> >> >
>>> >> >>
>>> >>
>>>
http://www.nabble.com/Problem-with-ManyToMany-Mapping-tf4009715s2369.html#a11404132
>>> >> >> > >>> Sent from the AppFuse - User mailing list archive at
>>> >> >> Nabble.com<http://nabble.com/>
>>> >> >> > .
>>> >> >> > >>>
>>> >> >> > >>>
>>> >> >> >
>>> >>
---------------------------------------------------------------------
>>> >> >> > >>> To unsubscribe, e-mail:
>>> [EMAIL PROTECTED]
>>> >> >> > >>> For additional commands, e-mail:
>>> [EMAIL PROTECTED]
>>> >> >> > >>>
>>> >> >> > >>>
>>> >> >> > >>
>>> >> >> > >>
>>> >> >> > >
>>> >> >> > >
>>> >> >> >
>>> >> >> > --
>>> >> >> > View this message in context:
>>> >> >>
>>> >>
>>>
http://www.nabble.com/Problem-with-ManyToMany-Mapping-tf4009715s2369.html#a11456759
>>> >> >> >
>>> >> >> > Sent from the AppFuse - User mailing list archive at
>>> >> >> Nabble.com<http://nabble.com/>
>>> >> >> > .
>>> >> >> >
>>> >> >> >
>>> >>
---------------------------------------------------------------------
>>> >> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> >> >> > For additional commands, e-mail:
[EMAIL PROTECTED]
>>> >> >> >
>>> >> >> >
>>> >> >>
>>> >> >
>>> >> >
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>>
http://www.nabble.com/Problem-with-ManyToMany-Mapping-tf4009715s2369.html#a11496601
>>> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>> >>
>>> >>
---------------------------------------------------------------------
>>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>>> >>
>>> >>
>>> >
>>> >
>>> > --
>>> > /fadhli
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>>
http://www.nabble.com/Problem-with-ManyToMany-Mapping-tf4009715s2369.html#a11496979
>>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/Problem-with-ManyToMany-Mapping-tf4009715s2369.html#a11512077
Sent from the AppFuse - User mailing list archive at Nabble.com.

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


Reply via email to