struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Registering aliases from within a plugin
Date Tue, 19 Nov 2013 07:30:27 GMT
I think I found intermediate solution - I'm going to extend struts.dtd
and define new structure bean-selector. It will contain a class which
will provide aliases ;-)

The change is backward compatible as the element isn't required, it is
optional. And thus also allow to move all the aliases from
BeanSelectionProvider to struts-default.xml

<!ELEMENT bean-selector (#PCDATA)>
<!ATTLIST bean-selector
        class CDATA #REQUIRED
>


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

2013/11/18 Lukasz Lenart <lukaszlenart@apache.org>:
> Hi,
>
> As I'm working in extracting Velocity support into a plugin, I have
> faced a small problem: how to register alias to allow override
> VelocityManager by user?
>
> Right now, it is done via BeanSelectionProvider [1] where each class
> which can be aliased is defined statically and then the provider is
> statically added in Dispatcher [2]. Now I need a way to allow define
> the same but inside the plugin.
>
> The first idea is to define a new type of configuration file:
> struts-aliases.xml but I would like to have a programmatic way, any
> thoughts?
>
> [1] https://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/config/BeanSelectionProvider.java?view=markup#l366
> [2] https://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/Dispatcher.java?view=markup#l449
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/

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


Mime
View raw message