struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nils-Helge Garli Hegvik <nil...@gmail.com>
Subject Re: Alternative UrlRenderer bean
Date Mon, 15 Nov 2010 11:41:22 GMT
You can take a look at how the portlet plugin does this (which was
actually why the UrlRenderer bean was created in the first place). In
addition to defining the bean, you need to tell Struts to use your
renderer:

The portlet plugin does it like this:

<bean type="org.apache.struts2.components.UrlRenderer" name="portlet"
class="org.apache.struts2.components.PortletUrlRenderer"/>
<constant name="struts.urlRenderer" value="portlet" />

Nils-H

On Mon, Nov 15, 2010 at 12:37 PM, GF <ganfab@gmail.com> wrote:
> Hello everyone.
> i want to use a custom UrlRenderer bean.
> reading Struts2 source code i found that is used to "render" the URLs
> generated by <s:url ..>
>
> If in my struts.xml I insert:
>
> <bean type="org.apache.struts2.components.UrlRenderer" name="mystruts"
> class="org.apache.struts2.components.MyUrlRenderer"/>
>
> Nothing happens, probably because Struts2 continue to inject the
> renderer with "struts" name.
>
> If in my struts.xml I insert
>
> <bean type="org.apache.struts2.components.UrlRenderer" name="struts"
> class="org.apache.struts2.components.MyUrlRenderer"/>
>
> the struts inizialization fails, since that bean with "struts" name is
> already defined.
>
> Any idea?
>
> Thank you
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Mime
View raw message