You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Andrew Hill <an...@gridnode.com> on 2003/07/07 11:39:53 UTC

RE: Request/Response Utils future request

+1 (& crossposting to struts-dev to try and spark some discussion on
implementation)

Couldn't agree more George.

I too have come across *numerous* situations where I wanted to override and
do things a little bit differently for certain cases. And not just with
Request & Response Utils but also with a lot of the commons stuff like
BeanUtils, PropertyUtils etc....

This is a good example of why its best to use singletons for utility
classes - even if all the methods can be static - as other folk may want to
override...

If you want them to look at it you will need to add it as an enhancement
request in bugzilla:
http://issues.apache.org/bugzilla/

-----Original Message-----
From: george.baxter@convergys.com [mailto:george.baxter@convergys.com]
Sent: Monday, 7 July 2003 17:25
To: struts-user@jakarta.apache.org
Subject: Request/Response Utils future request


For a future version of Struts, I'd like to request that the Request and
Response Utils be an instantiated object that we can subclass.

One reason is that I'd like to override the 'filter' method of
RequestUtils.  It currently iterates through every character in the string.
I have another 'filter' that I use for i18n purposes (LTR and RTL displays)
that does the same thing, and I don't want to have to iterate through a
string twice!

In addition, the filter seems to be missing a few, such as the british
pound symbol.

Since I currently cannot override this method, I have to choose between
doing the iteration twice or not use the struts jsp tags... ugly choice,
no?

Thanks!

-gjb

e-mail George.Baxter@convergys.com
www.convergys.com

--
"NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be
corrected."



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


RE: Request/Response Utils future request

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 7 Jul 2003, Andrew Hill wrote:

> Date: Mon, 7 Jul 2003 17:39:53 +0800
> From: Andrew Hill <an...@gridnode.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>,
>      andrew.david.hill@gridnode.com
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Cc: Struts-Dev <st...@jakarta.apache.org>
> Subject: RE: Request/Response Utils future request
>
> +1 (& crossposting to struts-dev to try and spark some discussion on
> implementation)
>
> Couldn't agree more George.
>
> I too have come across *numerous* situations where I wanted to override and
> do things a little bit differently for certain cases. And not just with
> Request & Response Utils but also with a lot of the commons stuff like
> BeanUtils, PropertyUtils etc....
>

You will note that BeanUtils is migrating towards separate objects
(BeanUtilsBean and PropertyUtilsBean), with the static signatures
maintained for backwards compatibility.  This is an important issue for
cases where you want commons-beanutils.jar to be shared across multiple
webapps but not have the beans from each webapp interfere with each other
-- I imagine we will run into similar issues for Struts utilities where
different webapps want different customized behavior for the common
classes.

Craig

> This is a good example of why its best to use singletons for utility
> classes - even if all the methods can be static - as other folk may want to
> override...
>
> If you want them to look at it you will need to add it as an enhancement
> request in bugzilla:
> http://issues.apache.org/bugzilla/
>
> -----Original Message-----
> From: george.baxter@convergys.com [mailto:george.baxter@convergys.com]
> Sent: Monday, 7 July 2003 17:25
> To: struts-user@jakarta.apache.org
> Subject: Request/Response Utils future request
>
>
> For a future version of Struts, I'd like to request that the Request and
> Response Utils be an instantiated object that we can subclass.
>
> One reason is that I'd like to override the 'filter' method of
> RequestUtils.  It currently iterates through every character in the string.
> I have another 'filter' that I use for i18n purposes (LTR and RTL displays)
> that does the same thing, and I don't want to have to iterate through a
> string twice!
>
> In addition, the filter seems to be missing a few, such as the british
> pound symbol.
>
> Since I currently cannot override this method, I have to choose between
> doing the iteration twice or not use the struts jsp tags... ugly choice,
> no?
>
> Thanks!
>
> -gjb
>
> e-mail George.Baxter@convergys.com
> www.convergys.com
>
> --
> "NOTICE:  The information contained in this electronic mail transmission is
> intended by Convergys Corporation for the use of the named individual or
> entity to which it is directed and may contain information that is
> privileged or otherwise confidential.  If you have received this electronic
> mail transmission in error, please delete it from your system without
> copying or forwarding it, and notify the sender of the error by reply email
> or by telephone (collect), so that the sender's address records can be
> corrected."
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


RE: Request/Response Utils future request

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 7 Jul 2003, Andrew Hill wrote:

> Date: Mon, 7 Jul 2003 17:39:53 +0800
> From: Andrew Hill <an...@gridnode.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>,
>      andrew.david.hill@gridnode.com
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Cc: Struts-Dev <st...@jakarta.apache.org>
> Subject: RE: Request/Response Utils future request
>
> +1 (& crossposting to struts-dev to try and spark some discussion on
> implementation)
>
> Couldn't agree more George.
>
> I too have come across *numerous* situations where I wanted to override and
> do things a little bit differently for certain cases. And not just with
> Request & Response Utils but also with a lot of the commons stuff like
> BeanUtils, PropertyUtils etc....
>

You will note that BeanUtils is migrating towards separate objects
(BeanUtilsBean and PropertyUtilsBean), with the static signatures
maintained for backwards compatibility.  This is an important issue for
cases where you want commons-beanutils.jar to be shared across multiple
webapps but not have the beans from each webapp interfere with each other
-- I imagine we will run into similar issues for Struts utilities where
different webapps want different customized behavior for the common
classes.

Craig

> This is a good example of why its best to use singletons for utility
> classes - even if all the methods can be static - as other folk may want to
> override...
>
> If you want them to look at it you will need to add it as an enhancement
> request in bugzilla:
> http://issues.apache.org/bugzilla/
>
> -----Original Message-----
> From: george.baxter@convergys.com [mailto:george.baxter@convergys.com]
> Sent: Monday, 7 July 2003 17:25
> To: struts-user@jakarta.apache.org
> Subject: Request/Response Utils future request
>
>
> For a future version of Struts, I'd like to request that the Request and
> Response Utils be an instantiated object that we can subclass.
>
> One reason is that I'd like to override the 'filter' method of
> RequestUtils.  It currently iterates through every character in the string.
> I have another 'filter' that I use for i18n purposes (LTR and RTL displays)
> that does the same thing, and I don't want to have to iterate through a
> string twice!
>
> In addition, the filter seems to be missing a few, such as the british
> pound symbol.
>
> Since I currently cannot override this method, I have to choose between
> doing the iteration twice or not use the struts jsp tags... ugly choice,
> no?
>
> Thanks!
>
> -gjb
>
> e-mail George.Baxter@convergys.com
> www.convergys.com
>
> --
> "NOTICE:  The information contained in this electronic mail transmission is
> intended by Convergys Corporation for the use of the named individual or
> entity to which it is directed and may contain information that is
> privileged or otherwise confidential.  If you have received this electronic
> mail transmission in error, please delete it from your system without
> copying or forwarding it, and notify the sender of the error by reply email
> or by telephone (collect), so that the sender's address records can be
> corrected."
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Request/Response Utils future request

Posted by David Graham <gr...@yahoo.com>.
This is one reason why static methods are evil.  RequestUtils will be
decomposed into smaller, more focused utility classes (like one for JSP
tags).  That will be a good time to make the change to a Singleton
pattern.  This has already happened with the new TokenProcessor class by
the way.

David

--- Andrew Hill <an...@gridnode.com> wrote:
> +1 (& crossposting to struts-dev to try and spark some discussion on
> implementation)
> 
> Couldn't agree more George.
> 
> I too have come across *numerous* situations where I wanted to override
> and
> do things a little bit differently for certain cases. And not just with
> Request & Response Utils but also with a lot of the commons stuff like
> BeanUtils, PropertyUtils etc....
> 
> This is a good example of why its best to use singletons for utility
> classes - even if all the methods can be static - as other folk may want
> to
> override...
> 
> If you want them to look at it you will need to add it as an enhancement
> request in bugzilla:
> http://issues.apache.org/bugzilla/
> 
> -----Original Message-----
> From: george.baxter@convergys.com [mailto:george.baxter@convergys.com]
> Sent: Monday, 7 July 2003 17:25
> To: struts-user@jakarta.apache.org
> Subject: Request/Response Utils future request
> 
> 
> For a future version of Struts, I'd like to request that the Request and
> Response Utils be an instantiated object that we can subclass.
> 
> One reason is that I'd like to override the 'filter' method of
> RequestUtils.  It currently iterates through every character in the
> string.
> I have another 'filter' that I use for i18n purposes (LTR and RTL
> displays)
> that does the same thing, and I don't want to have to iterate through a
> string twice!
> 
> In addition, the filter seems to be missing a few, such as the british
> pound symbol.
> 
> Since I currently cannot override this method, I have to choose between
> doing the iteration twice or not use the struts jsp tags... ugly choice,
> no?
> 
> Thanks!
> 
> -gjb
> 
> e-mail George.Baxter@convergys.com
> www.convergys.com
> 
> --
> "NOTICE:  The information contained in this electronic mail transmission
> is
> intended by Convergys Corporation for the use of the named individual or
> entity to which it is directed and may contain information that is
> privileged or otherwise confidential.  If you have received this
> electronic
> mail transmission in error, please delete it from your system without
> copying or forwarding it, and notify the sender of the error by reply
> email
> or by telephone (collect), so that the sender's address records can be
> corrected."
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org