All values null after Validate
Hi. I am using struts and I am doing a form validate. When the user types in more than on thing and one of them fails validation, all the values is returned blank. Is there anyway to keep the values when validate error? BR Soren - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: All values null after Validate
That's great. Thanks both I'll try that right away Soren -Oprindelig meddelelse- Fra: Otto, Frank [mailto:[EMAIL PROTECTED] Sendt: 15. januar 2004 11:35 Til: 'Struts Users Mailing List' Emne: AW: All values null after Validate Hi Oliver, You can use html:text property=username/ in [extends ActionForm] too. Regards, Frank -Ursprüngliche Nachricht- Von: Oliver Thiel [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 15. Januar 2004 11:21 An: 'Struts Users Mailing List' Betreff: AW: All values null after Validate Hi Søren, IF you use [extends ActionForm] you can use: input type=text name=username value=bean:write name=basicForm property=username / (in your jsp) OR: IF you use [extends ValidatorForm] you can use: html:text property=username/ (in your jsp) Hope that helps Oliver -Ursprüngliche Nachricht- Von: Søren Blidorf [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 15. Januar 2004 11:16 An: [EMAIL PROTECTED] Betreff: All values null after Validate Hi. I am using struts and I am doing a form validate. When the user types in more than on thing and one of them fails validation, all the values is returned blank. Is there anyway to keep the values when validate error? BR Soren - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: All values null after Validate
Hi again. I am doing it like this: bean:define name=element id=myDate property= myDate / INPUT NAME=myDate TYPE=text SIZE=30 value=%= getDateFormatted(myDate) % Is it possible then? Soren -Oprindelig meddelelse- Fra: Otto, Frank [mailto:[EMAIL PROTECTED] Sendt: 15. januar 2004 11:35 Til: 'Struts Users Mailing List' Emne: AW: All values null after Validate Hi Oliver, You can use html:text property=username/ in [extends ActionForm] too. Regards, Frank -Ursprüngliche Nachricht- Von: Oliver Thiel [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 15. Januar 2004 11:21 An: 'Struts Users Mailing List' Betreff: AW: All values null after Validate Hi Søren, IF you use [extends ActionForm] you can use: input type=text name=username value=bean:write name=basicForm property=username / (in your jsp) OR: IF you use [extends ValidatorForm] you can use: html:text property=username/ (in your jsp) Hope that helps Oliver -Ursprüngliche Nachricht- Von: Søren Blidorf [mailto:[EMAIL PROTECTED] Gesendet: Donnerstag, 15. Januar 2004 11:16 An: [EMAIL PROTECTED] Betreff: All values null after Validate Hi. I am using struts and I am doing a form validate. When the user types in more than on thing and one of them fails validation, all the values is returned blank. Is there anyway to keep the values when validate error? BR Soren - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Syntax error at token 0, line 0 offset 0.
Hi. I am trying to update values in my db and I get the following error: java.sql.SQLException: [JRun][SQLServer JDBC Driver]Syntax error at token 0, line 0 offset 0. It is only when the values in my STRUTS form is null. It is not a problem with other similar actions. Can anybody give me an idear of what is wrong? Søren Blidorf Nolas Consulting www.nolas.dk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Syntax error at token 0, line 0 offset 0.
By the way. It seems that the UPDATE is working fine. The values that are not null are updated. BUT I would like to get rid of the error message Soren -Oprindelig meddelelse- Fra: Søren Blidorf [mailto:[EMAIL PROTECTED] Sendt: 21. marts 2003 12:55 Til: [EMAIL PROTECTED] Emne: Syntax error at token 0, line 0 offset 0. Hi. I am trying to update values in my db and I get the following error: java.sql.SQLException: [JRun][SQLServer JDBC Driver]Syntax error at token 0, line 0 offset 0. It is only when the values in my STRUTS form is null. It is not a problem with other similar actions. Can anybody give me an idear of what is wrong? Søren Blidorf Nolas Consulting www.nolas.dk - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Sort a collection in alphabetic order
Hi. I need to sort my collection people in alphabetic order by lastname, firstname. Can anybody help me? I guess I should do it in the Action and not when displayed in jsp page. Collection people = new ArrayList(); while( rs.next() ) { PeopleBean pb = new PeopleBean(); pb.setId(rs.getInt(ID)); pb.setFirstname( rs.getString( FIRSTNAME )); pb.setLastname( rs.getString( LASTNAME )); } people.add( pb ); Søren Blidorf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Sort a collection in alphabetic order
It is not possible. The select is in a while (rs.next()) {} depending on another value. (Not easy to explain!!) I am a ware of normal SQL order by -Oprindelig meddelelse- Fra: Dave Newton [mailto:[EMAIL PROTECTED] Sendt: 10. marts 2003 19:20 Til: Struts Users Mailing List Emne: Re: Sort a collection in alphabetic order On Mon, 2003-03-10 at 13:16, Søren Blidorf wrote: I need to sort my collection people in alphabetic order by lastname, firstname. Can anybody help me? Most algorithm books will give you more information than you want on sorting. Why not just do it in the query and let the db do it? Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Sort a collection in alphabetic order
Sorry, but I can't get it to work. Does any body have a simple example I can look at? Soren -Oprindelig meddelelse- Fra: nash e. foster [mailto:[EMAIL PROTECTED] Sendt: 10. marts 2003 19:27 Til: Struts Users Mailing List Emne: Re: Sort a collection in alphabetic order You could have your PeopleBean implement Comparable, which is pretty easy, and then use TreeSet to create a sorted set using your compareTo method. -nash On Monday, March 10, 2003, at 01:16 PM, Søren Blidorf wrote: Hi. I need to sort my collection people in alphabetic order by lastname, firstname. Can anybody help me? I guess I should do it in the Action and not when displayed in jsp page. Collection people = new ArrayList(); while( rs.next() ) { PeopleBean pb = new PeopleBean(); pb.setId(rs.getInt(ID)); pb.setFirstname( rs.getString( FIRSTNAME )); pb.setLastname( rs.getString( LASTNAME )); } people.add( pb ); Søren Blidorf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This message is intended only for the use of the intended recipient and may contain information that is PRIVILEGED and/or CONFIDENTIAL. If you are not the intended recipient, you are hereby notified that any use, dissemination, disclosure or copying of this communication is strictly prohibited. If you have received this communication in error, please destroy all copies of this message and its attachments and notify us immediately. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: Sort a collection in alphabetic order
Thanks a million. You just made my day. Soren -Oprindelig meddelelse- Fra: Yan, Charlene [mailto:[EMAIL PROTECTED] Sendt: 10. marts 2003 23:12 Til: Struts Users Mailing List Emne: RE: Sort a collection in alphabetic order Try this: import org.apache.commons.beanutils.BeanComparator; Collections.sort(people, new BeanComparator(lastname)); Charlene -Original Message- From: Søren Blidorf [mailto:[EMAIL PROTECTED] Sent: Monday, March 10, 2003 4:33 PM To: 'Struts Users Mailing List' Subject: SV: Sort a collection in alphabetic order Sorry, but I can't get it to work. Does any body have a simple example I can look at? Soren -Oprindelig meddelelse- Fra: nash e. foster [mailto:[EMAIL PROTECTED] Sendt: 10. marts 2003 19:27 Til: Struts Users Mailing List Emne: Re: Sort a collection in alphabetic order You could have your PeopleBean implement Comparable, which is pretty easy, and then use TreeSet to create a sorted set using your compareTo method. -nash On Monday, March 10, 2003, at 01:16 PM, Søren Blidorf wrote: Hi. I need to sort my collection people in alphabetic order by lastname, firstname. Can anybody help me? I guess I should do it in the Action and not when displayed in jsp page. Collection people = new ArrayList(); while( rs.next() ) { PeopleBean pb = new PeopleBean(); pb.setId(rs.getInt(ID)); pb.setFirstname( rs.getString( FIRSTNAME )); pb.setLastname( rs.getString( LASTNAME )); } people.add( pb ); Søren Blidorf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] *** This message is intended only for the use of the intended recipient and may contain information that is PRIVILEGED and/or CONFIDENTIAL. If you are not the intended recipient, you are hereby notified that any use, dissemination, disclosure or copying of this communication is strictly prohibited. If you have received this communication in error, please destroy all copies of this message and its attachments and notify us immediately. *** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: [OT] JDBCRealm question
Yes, username is primary key in both -Oprindelig meddelelse- Fra: Dan Allen [mailto:[EMAIL PROTECTED] Sendt: 9. marts 2003 20:14 Til: Struts-User List Emne: [OT] JDBCRealm question This is a simple one, pardon the request for advice. In the specs for JDBCRealm it talks about a username column being in the users table and in the user_role table. Does this mean that the username column has to be the primary key in the users table and not a user_id?? I thought it was bad design to make a text field a primary key since it means that it would have to be updated in two places if the user changed usernames, or are we sticking with the requirment that users can't change usernames or that it is an uncommon task? Dan -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Daniel Allen, [EMAIL PROTECTED] http://www.mojavelinux.com/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [Frodo]: He deserves death. [Gandalf]: Deserves it! I daresay he does. Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SV: date format problems
Yes, it's a good point, but the only place my date is a String, is in the ActionForm. Would you store the date as long there? -Oprindelig meddelelse- Fra: apachep2 [mailto:[EMAIL PROTECTED] Sendt: 7. marts 2003 15:22 Til: 'Struts Users Mailing List' Emne: RE: date format problems Never try to store a date as a string. It creates a lot of date format problems. As I have said, store it as a long so that you can easily do the conversion. -Original Message- From: Søren Blidorf [mailto:[EMAIL PROTECTED] Sent: March 6, 2003 6:42 PM To: 'Struts Users Mailing List' Subject: SV: date format problems Hi. Thanks for all the answers I was trying different things because nothing would work for me. I need one thing: Convert the String value theForm.GetMyDate() so that I can insert it in my sql as -MM-dd. I get the error java.lang.IllegalArgumentException: Cannot format given Object as a Date I will look at BeanUtils.copyProperties( beanToCopyTo, beanCopyingFrom );, but it is probably to complicated for me just now! What is the best way to fix it? -Oprindelig meddelelse- Fra: Chen, Gin [mailto:[EMAIL PROTECTED] Sendt: 6. marts 2003 16:31 Til: 'Struts Users Mailing List' Emne: RE: date format problems The standard for an actionForm is to have every field as String. All conversion (which should really be thought of as business logic) should occur in the Action classes or further down the food chain. If this is not possible in your case or does not solve what your working on then can you please give more details? -Tim -Original Message- From: Kandi Potter [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 10:21 AM To: Struts Users Mailing List Subject: RE: date format problems I'm no expert at struts but I convert and validate my dates in my Action or Business Class instead of the Form. I could be completely off-base here in my interpretation of the struts ActionForm though -Original Message- From: Søren Blidorf [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 10:07 AM To: [EMAIL PROTECTED] Subject: date format problems Hi. I have an action that gets a date from the MS SQL 2000 in -MM-dd. I convert it with simpledateformat as dd-MM- and put it in a jsp form. When submitting the form the date must be coverted back to -MM-DD before another actions update the db. I am trying to convert the date value in the ActionForm, but I am getting the following error. Any idears? I am lost and it is very urgent Søren Blidorf HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:774) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.jav a:2061) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:550) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:170) at org.apache.catalina.core.StandardPipeline
opener.location.reload(true)
Hi. It may be off topic! In my STRUTS application I open a window and updates the db. After that I use the opener.location.reload(true) to update the page that displays the db values. When I do that I get the normal alert that the page is being refreshed, but normally when I use that code I do not get that alert. Could it be the Tomcat or a STRUTS thing!!! Søren Blidorf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Send variable from the Action to the forward jsp page
Hi Is it possible to send a variable from the Action to the forward jsp page Søren Blidorf - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
date format problems
Hi. I have an action that gets a date from the MS SQL 2000 in -MM-dd. I convert it with simpledateformat as dd-MM- and put it in a jsp form. When submitting the form the date must be coverted back to -MM-DD before another actions update the db. I am trying to convert the date value in the ActionForm, but I am getting the following error. Any idears? I am lost and it is very urgent Søren Blidorf HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:774) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.jav a:2061) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:550) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:43 2) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC onnection(Http11Protocol.java:386) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:53 4) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool .java:530) at java.lang.Thread.run(Thread.java:536) root cause java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav a:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor Impl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.util.PropertyUtils.setSimpleProperty(PropertyUtils.jav a:988) at org.apache.struts.util.PropertyUtils.setNestedProperty(PropertyUtils.jav a:904) at org.apache.struts.util.PropertyUtils.setProperty(PropertyUtils.java:932) at org.apache.struts.util.BeanUtils.populate(BeanUtils.java:509) at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:772
SV: date format problems
Hi. Thanks for all the answers I was trying different things because nothing would work for me. I need one thing: Convert the String value theForm.GetMyDate() so that I can insert it in my sql as -MM-dd. I get the error java.lang.IllegalArgumentException: Cannot format given Object as a Date I will look at BeanUtils.copyProperties( beanToCopyTo, beanCopyingFrom );, but it is probably to complicated for me just now! What is the best way to fix it? -Oprindelig meddelelse- Fra: Chen, Gin [mailto:[EMAIL PROTECTED] Sendt: 6. marts 2003 16:31 Til: 'Struts Users Mailing List' Emne: RE: date format problems The standard for an actionForm is to have every field as String. All conversion (which should really be thought of as business logic) should occur in the Action classes or further down the food chain. If this is not possible in your case or does not solve what your working on then can you please give more details? -Tim -Original Message- From: Kandi Potter [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 10:21 AM To: Struts Users Mailing List Subject: RE: date format problems I'm no expert at struts but I convert and validate my dates in my Action or Business Class instead of the Form. I could be completely off-base here in my interpretation of the struts ActionForm though -Original Message- From: Søren Blidorf [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 10:07 AM To: [EMAIL PROTECTED] Subject: date format problems Hi. I have an action that gets a date from the MS SQL 2000 in -MM-dd. I convert it with simpledateformat as dd-MM- and put it in a jsp form. When submitting the form the date must be coverted back to -MM-DD before another actions update the db. I am trying to convert the date value in the ActionForm, but I am getting the following error. Any idears? I am lost and it is very urgent Søren Blidorf HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:774) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.jav a:2061) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator Base.java:550) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:241 5) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java :180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherVa lve.java:170) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java :172) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve. java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext
SV: date format problems
That did it, Thanks a million. It looks almost like what I did, but I found my mistake. -Oprindelig meddelelse- Fra: Michael Cardon [mailto:[EMAIL PROTECTED] Sendt: 7. marts 2003 00:50 Til: Struts Users Mailing List Emne: RE: date format problems Here is what I do. The client enters a date of birth date as a string on the form, then I convert it to a java.sql.Date object in this method. /** * Sets the dobStr * @param dobStr The dobStr to set */ public void setDobStr(String dobStr) throws java.text.ParseException { this.dobStr = dobStr; // reset the Date object this.dobDate = null; if ((dobStr != null) (dobStr.length() 0)) { SimpleDateFormat sdf = new SimpleDateFormat(MM/dd/yy); sdf.setLenient(false); try { java.util.Date dt = sdf.parse(dobStr); this.dobDate = new java.sql.Date(dt.getTime()); } catch (ParseException pe) { throw new java.text.ParseException(Date Of Birth:, pe.getErrorOffset()); } } } -Original Message- From: Søren Blidorf [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 3:42 PM To: 'Struts Users Mailing List' Subject: SV: date format problems Hi. Thanks for all the answers I was trying different things because nothing would work for me. I need one thing: Convert the String value theForm.GetMyDate() so that I can insert it in my sql as -MM-dd. I get the error java.lang.IllegalArgumentException: Cannot format given Object as a Date I will look at BeanUtils.copyProperties( beanToCopyTo, beanCopyingFrom );, but it is probably to complicated for me just now! What is the best way to fix it? -Oprindelig meddelelse- Fra: Chen, Gin [mailto:[EMAIL PROTECTED] Sendt: 6. marts 2003 16:31 Til: 'Struts Users Mailing List' Emne: RE: date format problems The standard for an actionForm is to have every field as String. All conversion (which should really be thought of as business logic) should occur in the Action classes or further down the food chain. If this is not possible in your case or does not solve what your working on then can you please give more details? -Tim -Original Message- From: Kandi Potter [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 10:21 AM To: Struts Users Mailing List Subject: RE: date format problems I'm no expert at struts but I convert and validate my dates in my Action or Business Class instead of the Form. I could be completely off-base here in my interpretation of the struts ActionForm though -Original Message- From: Søren Blidorf [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 10:07 AM To: [EMAIL PROTECTED] Subject: date format problems Hi. I have an action that gets a date from the MS SQL 2000 in -MM-dd. I convert it with simpledateformat as dd-MM- and put it in a jsp form. When submitting the form the date must be coverted back to -MM-DD before another actions update the db. I am trying to convert the date value in the ActionForm, but I am getting the following error. Any idears? I am lost and it is very urgent Søren Blidorf HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception javax.servlet.ServletException: BeanUtils.populate at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:774) at org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.jav a:2061) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1564) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica tionFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt erChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv e.java:260) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:4 80) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv e.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i nvokeNext(StandardPipeline.java:643