struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Petrelli <>
Subject Re: Why TagUtils.instance is final static. That cause me a lot of problem.. Is a small change can be done ...?
Date Tue, 13 Jun 2006 11:57:46 GMT
David Gagnon ha scritto:
> Hi Antonio,
>> I suppose that you want to use some window-scoped attribute in your 
>> JSP page, right?
>> In this case I think that you could "copy" you attribute from window 
>> scope to page scope (probably with some custom tag library) and then 
>> use it, without changing Struts codebase.
>> HTH
>> Antonio
> Yes that would be a workaround indeed but somewhat cumbersome since I 
> use this scope everywhere.  I do think struts should offer a way to 
> change TagUtils behavior.
> With the :  private final TagUtils instance;  there is clearly no way 
> in :-(  It should be at least: protected TagUtils instance  Or offers 
> a way to specify the implementation to use.

In part I agree with you: the main motivation to use singleton pattern 
instead of a class with all static methods is to let someone else extend it.

> I did an webBase ERP and in this context the window scope make sense.  
> One session, 3 windows, 1 Request and 1 page scope.  And I do want to 
> change the implementation because this way I can use all the Struts 
> taglib without a change!

You are correct, but what if you are going to use JSTL tags? Do you have 
to change that codebase too?
The big problem with scoping is that the servlet specification support 
only the 4 famous scopes (application, session, request, page). Other 
frameworks are on the path of expanding the number of scopes (Tapestry, 
Spring, JBoss Seam), though I don't know if they support window scope.
Even I am going to publish a library for managing scopes (I am only 
waiting for review from Sourceforge team) independently from the 
framework (it can be used even with bare servlets).
I think that scoping cannot be solved with a change like that, but there 
should be some substantial change.

> Maybe I need to open a BUG to propose the enhancement?
> Is that make sense?

If you changed Struts code and it worked, then file a bug ticket for the 
enhancement, I think that many other can benefit from this change.


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

View raw message