You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michal Maczka <mm...@interia.pl> on 2003/06/03 19:37:45 UTC

Using functionality of in custom tag library

What's is the easiest way of using the Struts Resources (messages)
which are normally accessible through <bean:message> tag in a custom tag
library.

I want to have something like:

<mytag  label="message.id" >

where message.id is a key in properties files.


Michal





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


Re: Using functionality of in custom tag library

Posted by James Mitchell <jm...@apache.org>.
I think you are right to use struts tags to get the message from the bundle.
You could wrap bean:message with bean:define and do as you suggest or grab
it as body content (as you also suggest).  That is a decision you will have
to make since its your own custom tag.  Sorry I couldn't help more.

--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org
770-822-3359
AIM:jmitchtx


----- Original Message ----- 
From: "Michal Maczka" <mm...@interia.pl>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, June 03, 2003 4:14 PM
Subject: RE: Using functionality of <bean:message>in custom tag library


> > -----Original Message-----
> > From: James Mitchell [mailto:jmitchell@apache.org]
> > Sent: Tuesday, June 03, 2003 7:46 PM
> > To: Struts Users Mailing List
> > Subject: Re: Using functionality of <bean:message>in custom tag library
> >
> >
> > The easiest way is to look at how it's done with struts custom tags.
> >
> > Download the source or just browse cvs:
> > http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apa
> > che/struts/taglib/bean/MessageTag.java?rev=HEAD&content-type=text/
> > vnd.viewcvs-markup
> >
>
> Yeah...  I alredy looked at this before asking. It means that I will need
to
> copy/past
> struts code into my tag library.
>
> There is no other way? E.g through variable?
>
> (syntax is just hipotethical)
>
> a= <bean:message ....>
>
> <mytag label="<%=a %>" >
>
> Michal
>
> P.S.
> surly in worst case I can just wrap <bean:message > in my own tag which
will
> get the message and
> e.g. set it as a request atrribute...but this is pure hacking
>
>
> >
> > --
> > James Mitchell
> > Software Developer/Struts Evangelist
> > http://www.struts-atlanta.org
> >
> >
> >
> > ----- Original Message -----
> > From: "Michal Maczka" <mm...@interia.pl>
> > To: <st...@jakarta.apache.org>
> > Sent: Tuesday, June 03, 2003 1:37 PM
> > Subject: Using functionality of <bean:message>in custom tag library
> >
> >
> > > What's is the easiest way of using the Struts Resources (messages)
> > > which are normally accessible through <bean:message> tag in a custom
tag
> > > library.
> > >
> > > I want to have something like:
> > >
> > > <mytag  label="message.id" >
> > >
> > > where message.id is a key in properties files.
> > >
> > >
> > > Michal
> > >
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
> >
> >
> > ----------------------------------------------------------------------
> > Biznesowy portal INTERIA.PL >>> http://link.interia.pl/f1731
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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


RE: Using functionality of in custom tag library

Posted by Michal Maczka <mm...@interia.pl>.
> -----Original Message-----
> From: James Mitchell [mailto:jmitchell@apache.org]
> Sent: Tuesday, June 03, 2003 7:46 PM
> To: Struts Users Mailing List
> Subject: Re: Using functionality of <bean:message>in custom tag library
>
>
> The easiest way is to look at how it's done with struts custom tags.
>
> Download the source or just browse cvs:
> http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apa
> che/struts/taglib/bean/MessageTag.java?rev=HEAD&content-type=text/
> vnd.viewcvs-markup
>

Yeah...  I alredy looked at this before asking. It means that I will need to
copy/past
struts code into my tag library.

There is no other way? E.g through variable?

(syntax is just hipotethical)

a= <bean:message ....>

<mytag label="<%=a %>" >

Michal

P.S.
surly in worst case I can just wrap <bean:message > in my own tag which will
get the message and
e.g. set it as a request atrribute...but this is pure hacking


>
> --
> James Mitchell
> Software Developer/Struts Evangelist
> http://www.struts-atlanta.org
>
>
>
> ----- Original Message -----
> From: "Michal Maczka" <mm...@interia.pl>
> To: <st...@jakarta.apache.org>
> Sent: Tuesday, June 03, 2003 1:37 PM
> Subject: Using functionality of <bean:message>in custom tag library
>
>
> > What's is the easiest way of using the Struts Resources (messages)
> > which are normally accessible through <bean:message> tag in a custom tag
> > library.
> >
> > I want to have something like:
> >
> > <mytag  label="message.id" >
> >
> > where message.id is a key in properties files.
> >
> >
> > Michal
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ----------------------------------------------------------------------
> Biznesowy portal INTERIA.PL >>> http://link.interia.pl/f1731
>
>
>



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


Re: Using functionality of in custom tag library

Posted by James Mitchell <jm...@apache.org>.
The easiest way is to look at how it's done with struts custom tags.

Download the source or just browse cvs:
http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/struts/taglib/bean/MessageTag.java?rev=HEAD&content-type=text/vnd.viewcvs-markup


--
James Mitchell
Software Developer/Struts Evangelist
http://www.struts-atlanta.org



----- Original Message ----- 
From: "Michal Maczka" <mm...@interia.pl>
To: <st...@jakarta.apache.org>
Sent: Tuesday, June 03, 2003 1:37 PM
Subject: Using functionality of <bean:message>in custom tag library


> What's is the easiest way of using the Struts Resources (messages)
> which are normally accessible through <bean:message> tag in a custom tag
> library.
>
> I want to have something like:
>
> <mytag  label="message.id" >
>
> where message.id is a key in properties files.
>
>
> Michal
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org


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