You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ivan Žučenko <zu...@gmail.com> on 2007/10/30 16:35:55 UTC

changing template for s:text

Hi all,
I have an intention to enabel debug mode in my application and one of the
features should be that it shows resource name in front of every localized
text in jsp retrieved by <s:text>
For example <s:text name="RESOURCE_1">This is resource </s:text> would
render in html page as: [RESOURCE_1]This is resource.
I thought of making my custom tag with same fubctionality as in *
org.apache.struts2.components.Text *or try to extend  *
org.apache.struts2.components.Text  *or just modify text template. My first
idea was just to create custom theme for it but it is not possible since
text i snot UI tag.. So which way would you recomand t go?
Thanks Ivan

Re: changing template for s:text

Posted by Ivan Žučenko <zu...@gmail.com>.
Hi Tom,
not yet... but I have no experience contributing to project like this, so I
am afraid that my bothering this mail group would overweight the benefit...
Also there is  one big "?" what is the best way how to share "debug" flag
across the all session/page or any scope...  also since I am quite new to
the s2.. I am afraid of itroducing ineficiency into the code...
..anyway I will try to solve it and then come back with proposal on this
improvement... and... may be you or someone else may help me out to convert
it into "patch"
Ivan

On 10/30/07, Tom Schneider <sc...@gmail.com> wrote:
>
>
> The s:text tag is considered a data tag, not a UI tag, so there is no ftl
> template backing that take.  Your only option is to extend the tag to add
> the functionality that you describe.  The functionality you describe
> sounds
> like it might be useful to others.  Have you considered creating a patch
> to
> add this functionality to the existing text tag?
> Tom
>
>
> Ivan Žučenko wrote:
> >
> > Hi all,
> > I have an intention to enabel debug mode in my application and one of
> the
> > features should be that it shows resource name in front of every
> localized
> > text in jsp retrieved by <s:text>
> > For example <s:text name="RESOURCE_1">This is resource </s:text> would
> > render in html page as: [RESOURCE_1]This is resource.
> > I thought of making my custom tag with same fubctionality as in *
> > org.apache.struts2.components.Text *or try to extend  *
> > org.apache.struts2.components.Text   *or just modify text template. My
> > first
> > idea was just to create custom theme for it but it is not possible since
> > text i snot UI tag.. So which way would you recomand t go?
> > Thanks Ivan
> >
> >
>
> --
> View this message in context: http://www.nabble.com/changing-template-for-s%3Atext-tf4719322.html#a13491483
>
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: changing template for s:text

Posted by Tom Schneider <sc...@gmail.com>.
The s:text tag is considered a data tag, not a UI tag, so there is no ftl
template backing that take.  Your only option is to extend the tag to add
the functionality that you describe.  The functionality you describe sounds
like it might be useful to others.  Have you considered creating a patch to
add this functionality to the existing text tag?
Tom


Ivan Žučenko wrote:
> 
> Hi all,
> I have an intention to enabel debug mode in my application and one of the
> features should be that it shows resource name in front of every localized
> text in jsp retrieved by <s:text>
> For example <s:text name="RESOURCE_1">This is resource </s:text> would
> render in html page as: [RESOURCE_1]This is resource.
> I thought of making my custom tag with same fubctionality as in *
> org.apache.struts2.components.Text *or try to extend  *
> org.apache.struts2.components.Text  *or just modify text template. My
> first
> idea was just to create custom theme for it but it is not possible since
> text i snot UI tag.. So which way would you recomand t go?
> Thanks Ivan
> 
> 

-- 
View this message in context: http://www.nabble.com/changing-template-for-s%3Atext-tf4719322.html#a13491483
Sent from the Struts - User mailing list archive at Nabble.com.


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