RE: Date format

2003-08-01 Thread Tamia Ramírez
with type is your date, java.sql or java.util?

-Original Message-
From: Silverio Wagner Silva(Secorp) [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 10:27 AM
To: 'Struts Users Mailing List'
Subject: Date format


A beginner question:

When my date field is shown in my jsp it appears in a different way,
although my Locale object is correctly set.

Anyone knows how to solve this problem?

Thanks.




-
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]



RE: Date format

2003-08-01 Thread Tamia Ramírez
THIS CODE BECOME A JAVA.UTIL.DATE WITH FORMAT: dd/MM/ to a date MMM dd,
:

SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM dd, ");
String new_Date = dateFormatter.format(myDate);
reservacion.setFechaSalString(new_Date);

you may need to import java.text first.

I hope it can help to you too... it works for me.

-Original Message-
From: Silverio Wagner Silva(Secorp) [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 10:33 AM
To: 'Struts Users Mailing List'
Subject: RES: Date format


java.util.Date

-Mensagem original-
De: Tamia Ramírez [mailto:[EMAIL PROTECTED]
Enviada em: sexta-feira, 1 de agosto de 2003 13:33
Para: Struts Users Mailing List
Assunto: RE: Date format

with type is your date, java.sql or java.util?

-Original Message-
From: Silverio Wagner Silva(Secorp) [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 10:27 AM
To: 'Struts Users Mailing List'
Subject: Date format


A beginner question:

When my date field is shown in my jsp it appears in a different way,
although my Locale object is correctly set.

Anyone knows how to solve this problem?

Thanks.




-
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]



RE: Date format

2003-08-01 Thread Daniel H. F. e Silva
Hi all,

  Well, i recommend using JSTL tag formatNumber with type='currency'.
You can do this way:

  <%@ taglib uri="http://java.sun.com/jstl/fmt"; prefix="fmt" %>

  
  

  It worked for me.

Regards,
 Daniel Silva


--- Tamia_Ramírez <[EMAIL PROTECTED]> wrote:
> THIS CODE BECOME A JAVA.UTIL.DATE WITH FORMAT: dd/MM/ to a date MMM dd,
> :
> 
> SimpleDateFormat dateFormatter = new SimpleDateFormat("MMM dd, ");
> String new_Date = dateFormatter.format(myDate);
> reservacion.setFechaSalString(new_Date);
> 
> you may need to import java.text first.
> 
> I hope it can help to you too... it works for me.
> 
> -Original Message-
> From: Silverio Wagner Silva(Secorp) [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 01, 2003 10:33 AM
> To: 'Struts Users Mailing List'
> Subject: RES: Date format
> 
> 
> java.util.Date
> 
> -Mensagem original-
> De: Tamia Ramírez [mailto:[EMAIL PROTECTED]
> Enviada em: sexta-feira, 1 de agosto de 2003 13:33
> Para: Struts Users Mailing List
> Assunto: RE: Date format
> 
> with type is your date, java.sql or java.util?
> 
> -Original Message-
> From: Silverio Wagner Silva(Secorp) [mailto:[EMAIL PROTECTED]
> Sent: Friday, August 01, 2003 10:27 AM
> To: 'Struts Users Mailing List'
> Subject: Date format
> 
> 
> A beginner question:
> 
> When my date field is shown in my jsp it appears in a different way,
> although my Locale object is correctly set.
> 
> Anyone knows how to solve this problem?
> 
> Thanks.
> 
> 
> 
> 
> -
> 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]
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: date format

2003-02-17 Thread Desmond
Use the SimpleDateFormat to do it so. Refer this webpage
http://java.sun.com/docs/books/tutorial/i18n/format/simpleDateFormat.html

-Original Message-
From: usha [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 3:38 AM
To: [EMAIL PROTECTED]
Subject: date format


Hi

i need to display the date fields on the jsp in the format dd/MMM/.
is there any simple way i can get this like configuration or writing any
class etc.. if anybody has any ideas plz help me

Thanks
usha


-
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]




RE: date format

2003-02-17 Thread Mark Chaimungkalanont

Going for a "neat" solution, in our project, we tried extending sql.Date
and overwriting the toString method to output a date formatted with
SimpleDateFormat in dd/MM/ format, We then used this data type as our
Date type in our data beans so that when you do a bean:write on it, it will
output the date in the correct format

Unfortunately, we were using scaffold StorageBaseBean findCollection to get
our data and for some reason or another, it was having some casting issues.

We had to resort to creating xxxString version of the dates in the data
bean that converts the dats into their correct format before returning the
string

cheers

MC


   

  "Desmond"

  <[EMAIL PROTECTED]To:   "Struts Users Mailing List" 
<[EMAIL PROTECTED]>  
  t>   cc: 

           Subject:  RE: date format   

  19/02/2003 04:03 

  AM   

  Please respond to

  "Struts Users

  Mailing List"

   

   




Use the SimpleDateFormat to do it so. Refer this webpage
http://java.sun.com/docs/books/tutorial/i18n/format/simpleDateFormat.html

-Original Message-
From: usha [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 3:38 AM
To: [EMAIL PROTECTED]
Subject: date format


Hi

i need to display the date fields on the jsp in the format dd/MMM/.
is there any simple way i can get this like configuration or writing any
class etc.. if anybody has any ideas plz help me

Thanks
usha


-
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]




RE: date format

2002-12-18 Thread James Childers
Try 

customer.day.format=dd/MM/

mm = minutes in hour
MM = months

-= J

> -Original Message-
> From: Doug Ogateter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 18, 2002 9:52 AM
> To: Struts Users Mailing List
> Subject: date format
> 
> 
> 
> Hi:
> I have a problem with date format. I appreciate your help.
> Using , the web 
> page displayed the day as Sun Nov 30 00:00:00 EST 1980  . To 
> format the day, I added formatKey, so the above tag 
> bean:write tag becomes  property="day"  formatKey="customer.day.format"/>. In my 
> ApplicationResources.properties, I have 
> customer.day.format=dd/mm/. The problem is, after I used 
> the formatKey, it shows me 30/00/1980(the month part becomes 
> 00. It should show me 30/11/1980). 
> I am using struts1.1. Could anyone help me out? Is it the 
> formatKey problem? Thank you very much.
> 
> Regards,
> 
> Doug
> 
> 
> 
> -
> Post your free ad now! Yahoo! Canada Personals
> 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: date format

2002-12-18 Thread Doug Ogateter

James:
It WORKS! IT'S AMAZING!
THANK YOU VERY MUCH!
BEST REGARDS,
Doug
 James Childers <[EMAIL PROTECTED]> wrote:Try 

customer.day.format=dd/MM/

mm = minutes in hour
MM = months

-= J

> -Original Message-
> From: Doug Ogateter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 18, 2002 9:52 AM
> To: Struts Users Mailing List
> Subject: date format
> 
> 
> 
> Hi:
> I have a problem with date format. I appreciate your help.
> Using , the web 
> page displayed the day as Sun Nov 30 00:00:00 EST 1980 . To 
> format the day, I added formatKey, so the above tag 
> bean:write tag becomes > property="day" formatKey="customer.day.format"/>. In my 
> ApplicationResources.properties, I have 
> customer.day.format=dd/mm/. The problem is, after I used 
> the formatKey, it shows me 30/00/1980(the month part becomes 
> 00. It should show me 30/11/1980). 
> I am using struts1.1. Could anyone help me out? Is it the 
> formatKey problem? Thank you very much.
> 
> Regards,
> 
> Doug
> 
> 
> 
> -
> Post your free ad now! Yahoo! Canada Personals
> 

--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



-
Post your free ad now! Yahoo! Canada Personals



Re: Date format

2003-01-16 Thread Mark Lepkowski
Date formatString myDate = new SimpleDateFormat("dd MMM ").format( new 
java.util.Date() );

comp.lang.java.programmer is a good news group for java language related questions.
  - Original Message - 
  From: Suresh Addagalla 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, January 16, 2003 9:55 AM
  Subject: Date format


  Hi, 

  Please excuse me for the off-topic question, I need this urgently, so 
  posting it. 

  How can I get the current date format? (style: DateFormat.SHORT, locale: 
  Default) 

  I used: 

  SimpleDateFormat formatter = new SimpleDateFormat() ; 
  String format = formatter.toPattern() ; 

  It gives: 

  M/d/yy hh:mm a 

  But what I want is *only* the date part, excluding the time part of it. 

  Thanks, 
  Suresh 

   




RE: Date format

2003-01-16 Thread Mark Galbreath
Check out java.util.Calendar.  Particularly the constants.

Mark

-Original Message-
From: Suresh Addagalla [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 16, 2003 9:56 AM

How can I get the current date format? (style: DateFormat.SHORT, locale:
Default)



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Date format question

2003-02-05 Thread John Espey
the JSTL format parseDate tag will do the trick for you

-Original Message-
From: Swish [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 7:34 PM
To: Struts Users Mailing List
Subject: Date format question



Hello,

I was wondering if there is a way to use the  tag to convert a
string in sql time stamp format to a format of my choosing. I believe one
can write a Date object out using , but
can I convert a string "2002-12-25 00:00:00" to 12/25/2002.  Thanks in
advance for your suggestions!!!



-
Post your free ad now! Yahoo! Canada Personals


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




RE: Date format question

2003-02-05 Thread Garth Patil
if you are not using the jstl tags, you can also put a convenience method in 
your bean that looks something like this. refer to the java.text.DateFormat 
javadoc for how to format based on the parameters you pass to 
getDateTimeInstance.

public String getDateFormatted() {
  DateFormat df = 
DateFormat.getDateTimeInstance(DateFormat.LONG,DateFormat.SHORT);
  return df.format(getDate());
}



From: "John Espey" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: Date format question
Date: Wed, 5 Feb 2003 19:36:23 -0600

the JSTL format parseDate tag will do the trick for you

-Original Message-
From: Swish [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 7:34 PM
To: Struts Users Mailing List
Subject: Date format question



Hello,

I was wondering if there is a way to use the  tag to convert a
string in sql time stamp format to a format of my choosing. I believe one
can write a Date object out using , but
can I convert a string "2002-12-25 00:00:00" to 12/25/2002.  Thanks in
advance for your suggestions!!!



-
Post your free ad now! Yahoo! Canada Personals


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



_
STOP MORE SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


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



Re: date format problems

2003-03-06 Thread Gemes Tibor
2003. március 6. 16:06 dátummal Søren Blidorf ezt írtad:
> 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

Register a Converter for your String-Date Date-String conversion
with ConvertUtils. read javadocs
org.apache.commons.beanutils.ConvertUtils

Hth,

Tib

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



RE: date format problems

2003-03-06 Thread Kandi Potter
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(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.

RE: date format problems

2003-03-06 Thread Chen, Gin
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(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.thr

RE: date format problems

2003-03-06 Thread apachep2
Make sure it is a java.sql.Date during conversion using ConvertUtil.

-Original Message-
From: Gemes Tibor [mailto:[EMAIL PROTECTED] 
Sent: March 6, 2003 10:14 AM
To: Struts Users Mailing List
Subject: Re: date format problems

2003. március 6. 16:06 dátummal Søren Blidorf ezt írtad:
> 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

Register a Converter for your String-Date Date-String conversion
with ConvertUtils. read javadocs
org.apache.commons.beanutils.ConvertUtils

Hth,

Tib

-
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]



RE: date format problems

2003-03-06 Thread apachep2
You are not alone.

Re the original posting, I have another thought.

1. Date can be displayed using format string.
2. Date can be saved as long.

Will that reduce your conversion?

-Original Message-
From: Kandi Potter [mailto:[EMAIL PROTECTED] 
Sent: March 6, 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(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.InvocationTargetExce

Re: date format problems

2003-03-06 Thread Rick Reumann
On Thu, 6 Mar 2003 16:14:26 +0100
Gemes Tibor <[EMAIL PROTECTED]> wrote:

> 2003. március 6. 16:06 dátummal Søren Blidorf ezt írtad:
> > 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
> 
> Register a Converter for your String-Date Date-String conversion
> with ConvertUtils. read javadocs
> org.apache.commons.beanutils.ConvertUtils

Actually check the archives on "BeanUtils coverting java.util.Date." I
posted the converter you need to register in order to do the
conversion. If you can't find it in the archives let me know and I'll
look for it.



-- 
Rick Reumann

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



Re: date format problems

2003-03-06 Thread Rick Reumann
On Thu, 6 Mar 2003 10:39:08 -0500
"apachep2" <[EMAIL PROTECTED]> wrote:

> You are not alone.
> 
> Re the original posting, I have another thought.
> 
> 1. Date can be displayed using format string.
> 2. Date can be saved as long.
> 
> Will that reduce your conversion?

I think he wants to use BeanUtils.copyProperties() though which will do
the conversion for him. The approach you guys (I think) are taking
involves doing the actual conversion up front. If you register a
converter to BeanUtils, you can easily copy all the FormBean fields to a
DataTransferObject (or ValueObject, or whatever you want to call it:) in
one fell swoop:

BeanUtils.copyProperties( beanToCopyTo, beanCopyingFrom );

Normally you don't even need to register a converter, but, unless things
have changed recently, copyProperties() will not work by default on
java.util.Date property.


-- 
Rick Reumann

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



RE: date format problems

2003-03-06 Thread Michael Cardon
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)
at
org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
Base.java:550)
at
org.apache.catalina.core.StandardPipeline$StandardPipe

Re: date format problems

2003-03-06 Thread Gemes Tibor
For an example in a static block of your BaseAction class.

Tib 

2003. március 7. 00:05 dátummal Marco Tedone ezt írtad:
> How do you register a converter with ConvertUtils in Struts? I gave a look
> to the commons-beanutils package but I couldn't figure how to use the
> contract specified by these classes with Struts. Is there a way to register
> an automatic converter for all data sent back and forward from the browser?
>
> Marco
>
> > -Original Message-
> > From: Gemes Tibor [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 06, 2003 3:14 PM
> > To: Struts Users Mailing List
> > Subject: Re: date format problems
> >
> > 2003. március 6. 16:06 dátummal Søren Blidorf ezt írtad:
> > > 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
> >
> > Register a Converter for your String-Date Date-String
> > conversion with ConvertUtils. read javadocs
> > org.apache.commons.beanutils.ConvertUtils
> >
> > Hth,
> >
> > Tib


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



RE: date format problems

2003-03-07 Thread apachep2
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$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(St