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 <gan...@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-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

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

Reply via email to