You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-dev@jakarta.apache.org by Andre Beskrowni <be...@hotmail.com> on 2002/01/08 18:17:50 UTC

can scoping of ResourceBundle in i18n taglib be configurable?

first, let me say that the i18n taglib rocks.  it's extremely thorough, and 
quite simple to use.  i do find it a little annoying, however, that i need 
to put <i18n:bundle baseName="ResourceBundle"/> in every page when i'm using 
tiles.  what would be better is if i could call the tag once in the 
template, and all of the files included in the template could then access 
that resource bundle.  the apparent solution would be to add an optional 
attribute to BundleTag called "scope" (similar to what the struts tags have) 
which would allow you specify where to store the resource bundle.  this way, 
i could specify request scope and eliminate all of the duplication.

in addition to this slight modification of the BundleTag, you'd have to 
modify ResourceHelper.getBundle() to call pageContext.findAttribute(name) or 
pageContext.getAttribute(name, scope) rather than 
pageContext.getAttribute(name).  i don't see that it's a much bigger change 
than that.  it would be fully backward compatible, so it wouldn't affect 
anyone else's codebase.

it's quite possible that this has been discussed and rejected.  i couldn't 
find much when scanning the archives, but i did see at least a reference to 
this issue posted in 
<http://www.mail-archive.com/taglibs-dev@jakarta.apache.org/msg00348.html>, 
though i couldn't find the resolution.  if the those in charge are in 
agreement, i'm happy to donate the time add this capability.

ab


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


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: can scoping of ResourceBundle in i18n taglib be configurable?

Posted by Tim Dawson <td...@yahoo.com>.
Andre,

> first, let me say that the i18n taglib rocks.  it's extremely
> thorough, and quite simple to use.

Thanks for the feedback, and sorry for the delay in responding. I've
recently switched jobs, and was rather swamped on the way out & getting all
my email, etc. running again under my personal email account.

> i do find it a little annoying... add an optional attribute
> to BundleTag called "scope

yes, your suggestion is very close to what we ended up doing for the i18n
tags in the standard taglib. I can certainly make the changes you suggest
(and probably will, I'm off for a week and planning to do some of the stuff
I haven't gotten around to in a while), but I'd recommend that you take a
look at JSTL EA3 to see if you can use it at this point - the jakarta i18n
taglib that James Strachan and I wrote will be deprecated once the JSTL tags
are final.

Tim

> -----Original Message-----
> From: Andre Beskrowni [mailto:beskrowni@hotmail.com]
> Sent: Tuesday, January 08, 2002 11:18 AM
> To: taglibs-dev@jakarta.apache.org
> Subject: can scoping of ResourceBundle in i18n taglib be configurable?
>
>
> first, let me say that the i18n taglib rocks.  it's extremely
> thorough, and
> quite simple to use.  i do find it a little annoying,
> however, that i need
> to put <i18n:bundle baseName="ResourceBundle"/> in every page
> when i'm using
> tiles.  what would be better is if i could call the tag once in the
> template, and all of the files included in the template could
> then access
> that resource bundle.  the apparent solution would be to add
> an optional
> attribute to BundleTag called "scope" (similar to what the
> struts tags have)
> which would allow you specify where to store the resource
> bundle.  this way,
> i could specify request scope and eliminate all of the duplication.
>
> in addition to this slight modification of the BundleTag,
> you'd have to
> modify ResourceHelper.getBundle() to call
> pageContext.findAttribute(name) or
> pageContext.getAttribute(name, scope) rather than
> pageContext.getAttribute(name).  i don't see that it's a much
> bigger change
> than that.  it would be fully backward compatible, so it
> wouldn't affect
> anyone else's codebase.
>
> it's quite possible that this has been discussed and
> rejected.  i couldn't
> find much when scanning the archives, but i did see at least
> a reference to
> this issue posted in
> <http://www.mail-archive.com/taglibs-dev@jakarta.apache.org/ms
g00348.html>,
though i couldn't find the resolution.  if the those in charge are in
agreement, i'm happy to donate the time add this capability.

ab


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


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: can scoping of ResourceBundle in i18n taglib be configurable?

Posted by Tim Dawson <td...@yahoo.com>.
FYI - I checked in changes to add a new "scope" attribute to the bundle tag.
You all probably saw the CVS email on that - I didn't though, because I
recently switched email accounts and had forgotten to re-subscribe under the
new address.

If I've missed any relevant discussion about the checkins, my apologies.

Tim

> -----Original Message-----
> From: Andre Beskrowni [mailto:beskrowni@hotmail.com]
> Sent: Tuesday, January 08, 2002 11:18 AM
> To: taglibs-dev@jakarta.apache.org
> Subject: can scoping of ResourceBundle in i18n taglib be configurable?
>
>
> first, let me say that the i18n taglib rocks.  it's extremely
> thorough, and
> quite simple to use.  i do find it a little annoying,
> however, that i need
> to put <i18n:bundle baseName="ResourceBundle"/> in every page
> when i'm using
> tiles.  what would be better is if i could call the tag once in the
> template, and all of the files included in the template could
> then access
> that resource bundle.  the apparent solution would be to add
> an optional
> attribute to BundleTag called "scope" (similar to what the
> struts tags have)
> which would allow you specify where to store the resource
> bundle.  this way,
> i could specify request scope and eliminate all of the duplication.
>
> in addition to this slight modification of the BundleTag,
> you'd have to
> modify ResourceHelper.getBundle() to call
> pageContext.findAttribute(name) or
> pageContext.getAttribute(name, scope) rather than
> pageContext.getAttribute(name).  i don't see that it's a much
> bigger change
> than that.  it would be fully backward compatible, so it
> wouldn't affect
> anyone else's codebase.
>
> it's quite possible that this has been discussed and
> rejected.  i couldn't
> find much when scanning the archives, but i did see at least
> a reference to
> this issue posted in
> <http://www.mail-archive.com/taglibs-dev@jakarta.apache.org/ms
g00348.html>,
though i couldn't find the resolution.  if the those in charge are in
agreement, i'm happy to donate the time add this capability.

ab


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


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>