RE: This hopefully is a simple question that has been dealt with

2002-03-30 Thread Wellie W. Chao

Have you looked at the validator that comes with struts 1.1 beta? You can
look at validator.xml and validator-rules.xml in the blank application's
WEB-INF. It's for input though, as opposed to output. I haven't heard of
anything similar for output.

-Original Message-
From: Vladimir Levin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 10:48 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: This hopefully is a simple question that has been dealt
with


I haven't found the solution I will use yet to solve this problem
in my own project, so advice would definitely be helpful.

I found a taglibrary that purports to do this (at http://jsptags.com)

http://www.sqlt.com/taglib.html

I have not investigated using it just yet though. I think even
writing one's own tag to format dates and numbers should be easy
enough: just extend the bean:write tag to support a format
attribute and use the existing java formatting capabilities
(SimpleDateFormat, NumberFormat).

Doing arbitrary String masking would be cool too (typical
example is phone number formatting, currency formatting,
but I also have additional requirements). Does anyone know
of a taglib that does this kind of thing?

Vlad

Sorry to post this question again, but I'm still curious about this
...

I'm sure this question has come up but I'm not having much luck
searching the archives. I'm really new to Struts so I hope this
question isn't too out of place for this list. Lets say we are dealing
with Employee beans. I would my EmployeeBean to be able to have
members that are not all Strings. (In this example say Age would be an
int, birthDate a java.util.Date, etc.). Now in the sample app I'm
developing I have an EmployeeForm class also that currently has just
String datatypes for these fields. Having the information from the
actual form jsp's going to the EmployeeForm in as all Strings without
any conversions is not that big of a deal since wherever I do anything
with this data (jdbc inserts in the business logic I could always
covert them there if I need to ). However, I'm more concerned with
getting this information displayed correctly using the iterate tag.
For example, say I have on an Action class that gets back and
ArrayList of EmployeeBean objects and puts this list into the request
before forwarding. I really can't do:

logic:iterate id=row name=employeeList
 bean:write name=row property=firstName/BR
 bean:write name=row property=lastName/BR
 bean:write name=row property=age/BR
 bean:write name=row property=birthDate/BR
 BR
/logic:iterate

since I won't have birthDate formatted correctly, or say I was
returning a Double that I needed in a currency format. What is the
best way to deal with this situation? I could of course maybe have my
business logic return me a Collection of EmployeeForm beans instead
and inside the EmployeeForm beans there would be methods like
setBirthDateDate( Date date ) that would take a java.util.Date and
format it into a String and then call the EmployeeForm setBrithDate(
String date ). Although that would work, I'd still rather deal with
the business logic that returns a Collection of EmployeeBeans... as
this seems to make the most reusable sense (maybe the components later
won't just be for the web).

Thanks for any help.


--

Rick

mailto:[EMAIL PROTECTED]

Why do people in ship mutinies always ask for 'better treatment'? I'd
ask for a pinball machine, because with all that rocking back and
forth you'd probably be able to get a lot of free games.
   -Jack Handey


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





_
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com


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


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




Re[6]: Does this tag exist architecture [was] This hopefully is a simple question that has been dealt with

2002-03-30 Thread Rick Reumann

On Saturday, March 30, 2002, 10:33:32 AM, Vladimir Levin wrote:


VL   2) Performance penalty for copying a list of result beans to
VL  a list of form beans.

 Exactly. What if you a very large result set of Employee
 objects being returned. Now you have to go through this
 entire Collection again just to populate another very similar
 collection that has different data types for the members. I
 guess I just need to decide if this tradeoff is worth it.





--

Rick

mailto:[EMAIL PROTECTED]

If I was the head of a country that lost a war, and I had to sign a
peace treaty, just as I was signing, I'd glance over the treaty and
then suddenly act surprised. 'Wait a minute! I thought we won!'
  -Jack Handey


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




Re[2]: This hopefully is a simple question that has been dealt with

2002-03-30 Thread Rick Reumann

On Saturday, March 30, 2002, 8:06:10 AM, Wellie W. Chao wrote:

WWC Have you looked at the validator that comes with struts 1.1 beta?
WWC You can look at validator.xml and validator-rules.xml in the
WWC blank application's WEB-INF. It's for input though, as opposed to
WWC output. I haven't heard of anything similar for output.

 Yes, I'm actually using Validator. Like you mention, however, it
 doesn't really deal with displaying data that you get from the
 business tier.

WWC -Original Message-
WWC From: Vladimir Levin [mailto:[EMAIL PROTECTED]]
WWC Sent: Thursday, March 28, 2002 10:48 PM
WWC To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
WWC Subject: Re: This hopefully is a simple question that has been dealt
WWC with


WWC I haven't found the solution I will use yet to solve this problem
WWC in my own project, so advice would definitely be helpful.

WWC I found a taglibrary that purports to do this (at http://jsptags.com)

WWC http://www.sqlt.com/taglib.html

WWC I have not investigated using it just yet though. I think even
WWC writing one's own tag to format dates and numbers should be easy
WWC enough: just extend the bean:write tag to support a format
WWC attribute and use the existing java formatting capabilities
WWC (SimpleDateFormat, NumberFormat).

WWC Doing arbitrary String masking would be cool too (typical
WWC example is phone number formatting, currency formatting,
WWC but I also have additional requirements). Does anyone know
WWC of a taglib that does this kind of thing?

WWC Vlad

Sorry to post this question again, but I'm still curious about this
...

I'm sure this question has come up but I'm not having much luck
searching the archives. I'm really new to Struts so I hope this
question isn't too out of place for this list. Lets say we are dealing
with Employee beans. I would my EmployeeBean to be able to have
members that are not all Strings. (In this example say Age would be an
int, birthDate a java.util.Date, etc.). Now in the sample app I'm
developing I have an EmployeeForm class also that currently has just
String datatypes for these fields. Having the information from the
actual form jsp's going to the EmployeeForm in as all Strings without
any conversions is not that big of a deal since wherever I do anything
with this data (jdbc inserts in the business logic I could always
covert them there if I need to ). However, I'm more concerned with
getting this information displayed correctly using the iterate tag.
For example, say I have on an Action class that gets back and
ArrayList of EmployeeBean objects and puts this list into the request
before forwarding. I really can't do:

logic:iterate id=row name=employeeList
 bean:write name=row property=firstName/BR
 bean:write name=row property=lastName/BR
 bean:write name=row property=age/BR
 bean:write name=row property=birthDate/BR
 BR
/logic:iterate

since I won't have birthDate formatted correctly, or say I was
returning a Double that I needed in a currency format. What is the
best way to deal with this situation? I could of course maybe have my
business logic return me a Collection of EmployeeForm beans instead
and inside the EmployeeForm beans there would be methods like
setBirthDateDate( Date date ) that would take a java.util.Date and
format it into a String and then call the EmployeeForm setBrithDate(
String date ). Although that would work, I'd still rather deal with
the business logic that returns a Collection of EmployeeBeans... as
this seems to make the most reusable sense (maybe the components later
won't just be for the web).

Thanks for any help.


--

Rick

mailto:[EMAIL PROTECTED]

Why do people in ship mutinies always ask for 'better treatment'? I'd
ask for a pinball machine, because with all that rocking back and
forth you'd probably be able to get a lot of free games.
   -Jack Handey


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





WWC _
WWC Join the world’s largest e-mail service with MSN Hotmail.
WWC http://www.hotmail.com


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


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




--

Rick

mailto:[EMAIL PROTECTED]

If I was the head of a country that lost a war, and I had to sign a
peace treaty, just as I was signing, I'd glance over the treaty and
then suddenly act surprised. 'Wait a minute! I thought we won!'
  -Jack Handey


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




Does this tag exist architecture [was] This hopefully is a simple question that has been dealt with

2002-03-29 Thread Rick Reumann

On Friday, March 29, 2002, 11:19:25 AM, Maturo, Larry wrote:

ML We define a separate bean that mirrors our
ML EmployeeBean, but has string fields.  We then
ML get a list of EmployeeBeans and manually convert
ML them to a list of EmployeeStringBeans. :-)  It's
ML a pain, but it works.  Note that we only populate
ML the fields we actually plan on displaying, since
ML it is pointless to populate the other fields.

Thanks for your feedback Larry. (By the way nice job on that
AthensGroup paper on Struts if you wrote it).

Currently I already have an EmployeeForm bean (all String fields)
and an EmployeeBean (Strings, ints, etc.). The business tier does
the DB query and returns an ArrayList of EmployeeBeans. Now the
question becomes what next in order to iterate through this list
and display the EmployeeBean fields in a nice way (ie. proper date
format, currency format, etc.) ?...

I'm assuming from your reply that you might have extra logic
somewhere that will take that ArrayList of EmployeeBeans and loop
through the list and populate a new List of EmployeeForm beans. In
this step calls will be made to make sure the Strings in each
EmployeeForm object are correctly formatted. I see how this idea
will work, although it seems a shame that you have a perfectly
good ArrayList of Employee objects and now you are iterating
through it just to populate another ArrayList of Employee objects
with all String fields.

Before I looked into Struts I didn't see the big deal of iterating
though this list of regular EmployeeBean objects and then where
formatting was needed just call my helper util class to change the
format. For example:
%= RickUtils.displayDateAsString( bean.getBirthDate() ) %

I know, everyone says the above it bad because you now have
scriplets in your JSP code. Still, though, this seems to make more
sense to me than to going through the overhead of looping through
possibly a large ArrayList of beans in order to just populate a
similar ArrayList with just String fields. I suppose I will go
the later route in order to maintain the Struts architecture of
perfectly clean JSP pages.

Being new to struts and new to using tags, would it be that
difficult to create a tag that when passed a double it new to spit
out a display in some currency format or if it received a Date it
would display it in the proper format. I noticed there is a tag
library out there for display dates, but ideally I would like one
tag that would just pick up the datatype and if datatype is
double display this way, if Date display this way.

Does a tag library like the above already exist?

Thanks again for your feedback. I'm posting this to the list as
well for any other ideas.



ML There is a utility in Struts to help with this, but
ML I have never used it, since it always seemed like
ML learning to use it was more work than doing it
ML manually.

ML -- Larry Maturo
ML[EMAIL PROTECTED]


ML -Original Message-
ML From: Rick Reumann [mailto:[EMAIL PROTECTED]]
ML Sent: Thursday, March 28, 2002 9:09 PM
ML To: Struts Users Mailing List
ML Subject: This hopefully is a simple question that has been dealt with


ML Sorry to post this question again, but I'm still curious about this
ML ...

ML I'm sure this question has come up but I'm not having much luck
ML searching the archives. I'm really new to Struts so I hope this
ML question isn't too out of place for this list. Lets say we are dealing
ML with Employee beans. I would my EmployeeBean to be able to have
ML members that are not all Strings. (In this example say Age would be an
ML int, birthDate a java.util.Date, etc.). Now in the sample app I'm
ML developing I have an EmployeeForm class also that currently has just
ML String datatypes for these fields. Having the information from the
ML actual form jsp's going to the EmployeeForm in as all Strings without
ML any conversions is not that big of a deal since wherever I do anything
ML with this data (jdbc inserts in the business logic I could always
ML covert them there if I need to ). However, I'm more concerned with
ML getting this information displayed correctly using the iterate tag.
ML For example, say I have on an Action class that gets back and
ML ArrayList of EmployeeBean objects and puts this list into the request
ML before forwarding. I really can't do:

ML logic:iterate id=row name=employeeList
ML bean:write name=row property=firstName/BR
ML bean:write name=row property=lastName/BR
ML bean:write name=row property=age/BR
ML bean:write name=row property=birthDate/BR
ML BR
ML /logic:iterate

ML since I won't have birthDate formatted correctly, or say I was
ML returning a Double that I needed in a currency format. What is the
ML best way to deal with this situation? I could of course maybe have my
ML business logic return me a Collection

This hopefully is a simple question that has been dealt with

2002-03-28 Thread Rick Reumann

Sorry to post this question again, but I'm still curious about this
...

I'm sure this question has come up but I'm not having much luck
searching the archives. I'm really new to Struts so I hope this
question isn't too out of place for this list. Lets say we are dealing
with Employee beans. I would my EmployeeBean to be able to have
members that are not all Strings. (In this example say Age would be an
int, birthDate a java.util.Date, etc.). Now in the sample app I'm
developing I have an EmployeeForm class also that currently has just
String datatypes for these fields. Having the information from the
actual form jsp's going to the EmployeeForm in as all Strings without
any conversions is not that big of a deal since wherever I do anything
with this data (jdbc inserts in the business logic I could always
covert them there if I need to ). However, I'm more concerned with
getting this information displayed correctly using the iterate tag.
For example, say I have on an Action class that gets back and
ArrayList of EmployeeBean objects and puts this list into the request
before forwarding. I really can't do:

logic:iterate id=row name=employeeList
bean:write name=row property=firstName/BR
bean:write name=row property=lastName/BR
bean:write name=row property=age/BR
bean:write name=row property=birthDate/BR
BR
/logic:iterate

since I won't have birthDate formatted correctly, or say I was
returning a Double that I needed in a currency format. What is the
best way to deal with this situation? I could of course maybe have my
business logic return me a Collection of EmployeeForm beans instead
and inside the EmployeeForm beans there would be methods like
setBirthDateDate( Date date ) that would take a java.util.Date and
format it into a String and then call the EmployeeForm setBrithDate(
String date ). Although that would work, I'd still rather deal with
the business logic that returns a Collection of EmployeeBeans... as
this seems to make the most reusable sense (maybe the components later
won't just be for the web).

Thanks for any help.


--

Rick

mailto:[EMAIL PROTECTED]

Why do people in ship mutinies always ask for 'better treatment'? I'd
ask for a pinball machine, because with all that rocking back and
forth you'd probably be able to get a lot of free games.
  -Jack Handey


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




Re: This hopefully is a simple question that has been dealt with

2002-03-28 Thread Vladimir Levin

I haven't found the solution I will use yet to solve this problem
in my own project, so advice would definitely be helpful.

I found a taglibrary that purports to do this (at http://jsptags.com)

http://www.sqlt.com/taglib.html

I have not investigated using it just yet though. I think even
writing one's own tag to format dates and numbers should be easy
enough: just extend the bean:write tag to support a format
attribute and use the existing java formatting capabilities
(SimpleDateFormat, NumberFormat).

Doing arbitrary String masking would be cool too (typical
example is phone number formatting, currency formatting,
but I also have additional requirements). Does anyone know
of a taglib that does this kind of thing?

Vlad

Sorry to post this question again, but I'm still curious about this
...

I'm sure this question has come up but I'm not having much luck
searching the archives. I'm really new to Struts so I hope this
question isn't too out of place for this list. Lets say we are dealing
with Employee beans. I would my EmployeeBean to be able to have
members that are not all Strings. (In this example say Age would be an
int, birthDate a java.util.Date, etc.). Now in the sample app I'm
developing I have an EmployeeForm class also that currently has just
String datatypes for these fields. Having the information from the
actual form jsp's going to the EmployeeForm in as all Strings without
any conversions is not that big of a deal since wherever I do anything
with this data (jdbc inserts in the business logic I could always
covert them there if I need to ). However, I'm more concerned with
getting this information displayed correctly using the iterate tag.
For example, say I have on an Action class that gets back and
ArrayList of EmployeeBean objects and puts this list into the request
before forwarding. I really can't do:

logic:iterate id=row name=employeeList
 bean:write name=row property=firstName/BR
 bean:write name=row property=lastName/BR
 bean:write name=row property=age/BR
 bean:write name=row property=birthDate/BR
 BR
/logic:iterate

since I won't have birthDate formatted correctly, or say I was
returning a Double that I needed in a currency format. What is the
best way to deal with this situation? I could of course maybe have my
business logic return me a Collection of EmployeeForm beans instead
and inside the EmployeeForm beans there would be methods like
setBirthDateDate( Date date ) that would take a java.util.Date and
format it into a String and then call the EmployeeForm setBrithDate(
String date ). Although that would work, I'd still rather deal with
the business logic that returns a Collection of EmployeeBeans... as
this seems to make the most reusable sense (maybe the components later
won't just be for the web).

Thanks for any help.


--

Rick

mailto:[EMAIL PROTECTED]

Why do people in ship mutinies always ask for 'better treatment'? I'd
ask for a pinball machine, because with all that rocking back and
forth you'd probably be able to get a lot of free games.
   -Jack Handey


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





_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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