You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Philippe Petit <ph...@noos.fr> on 2003/02/17 18:24:45 UTC

simple question

Howto internationalize the labels of buttons
is it possible or not to nest tags this way : <input type="submit"
name="ListOrg" Value="<fmt:message
key=\"org.menu.btn.list\" bundle=\"${nav}\"/>" >
and if not, what are the interests of JSTL if we have to go back to JSP
expressions, or scriptlets so often, and if the use of tags needs
development skills?
is it "really" a decoupling between logic and presentation ? I doubt...

Regards
Philippe


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


Re: simple question

Posted by Philippe Petit <ph...@noos.fr>.
Thanks I'll try it with the c:set tag with a body,
I just tried before with a c:set tag with no body, just trying to affect the
result to the "value" attribute, and it wasn't working


Regards
Philippe

----- Original Message -----
From: "Jerome Jacobsen" <je...@gentootech.com>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Sent: Friday, February 21, 2003 1:47 PM
Subject: RE: simple question


> You can't have a tag as the value of another tag's attribute.  Maybe this
is
> what you want.
>
> <c:set var="items">
>   <fmt:message key="org.type" bundle="${lang}"/>
> </c:set>
>
> <c:forEach var="item" items="${items}">
> ...
>
>
>
> > -----Original Message-----
> > From: Philippe Petit [mailto:philippe.petit@noos.fr]
> > Sent: Friday, February 21, 2003 4:33 AM
> > To: Tag Libraries Users List; vernonw@gatewaytech.com
> > Subject: Re: simple question
> >
> >
> > Thanks to Hans I got my button working as well, but I have no idea for
the
> > upload button...
> > I'm facing another issue with tag encapsulation, I'm not able to have a
> > forEach tag use a fmt tag for its items value :
> > <select name="foo">
> >
> > <c:forEach var="item" items="<fmt:message key=\"org.type\"
> > bundle=\"${lang}\"/>">
> >
> > <option value="<c:out value="${item}"/>" ><c:out
> > value="${item}"/></option>
> >
> > </c:forEach>
> >
> > </select>
> >
> > I tried with and without quotes, etc and its not working... Any help is
> > welcome
> >
> > Regards
> > Cordialement
> >
> > ----- Original Message -----
> > From: "Vernon Wu" <ve...@gatewaytech.com>
> > To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
> > Cc: <ha...@gefionsoftware.com>
> > Sent: Thursday, February 20, 2003 5:54 PM
> > Subject: Re: simple question
> >
> >
> > >
> > > I have internationalized all buttons in my project successfully using
> > JSTL, except the file up load button. Any
> > > suggestions on having a internationalization label on a file upload
> > button?
> > >
> > >
> > > Thanks,
> > >
> > > Vernon
> > >
> > > 17/02/2003 10:30:07 AM, Hans Bergsten <ha...@gefionsoftware.com> wrote:
> > >
> > > >Philippe Petit wrote:
> > > >> Howto internationalize the labels of buttons
> > > >> is it possible or not to nest tags this way : <input type="submit"
> > > >> name="ListOrg" Value="<fmt:message
> > > >> key=\"org.menu.btn.list\" bundle=\"${nav}\"/>" >
> > > >> and if not, what are the interests of JSTL if we have to go
> > back to JSP
> > > >> expressions, or scriptlets so often, and if the use of tags needs
> > > >> development skills?
> > > >> is it "really" a decoupling between logic and presentation ?
> > I doubt...
> > > >
> > > >What you're trying to do works fine, except that there's no need to
> > > >escape the quotes around the <fmt:message> attributes (that actually
> > > >causes the problem you most likely experience).
> > > >
> > > >The key is to realize that the <input> element is not seen as an
> > > >element at all by the JSP container; it's just "template text", since
> > > >the JSP container doesn't know anything about HTML. So your example
> > > >should look like this:
> > > >
> > > >   <input type="submit" name="ListOrg"
> > > >     value="<fmt:message key="org.menu.btn.list" bundle="${nav}"/>" >
> > > >
> > > >Again, since the container regards the HTML <input> element as any
ol'
> > > >template text, this is no different than this as far as it's
concerned:
> > > >
> > > >   foo <fmt:message key="org.menu.btn.list" bundle="${nav}"/> bar
> > > >
> > > >It's just to us poor humans it looks confusing ;-)
> > > >
> > > >Hans
> > > >--
> > > >Hans Bergsten
<ha...@gefionsoftware.com>
> > > >Gefion Software
<http://www.gefionsoftware.com/>
> > > >Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL
1.0
> > > >Details at
<http://TheJSPBook.com/>
> > > >
> > > >
> > > >---------------------------------------------------------------------
> > > >To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> > > >For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>


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


RE: simple question

Posted by Jerome Jacobsen <je...@gentootech.com>.
You can't have a tag as the value of another tag's attribute.  Maybe this is
what you want.

<c:set var="items">
  <fmt:message key="org.type" bundle="${lang}"/>
</c:set>

<c:forEach var="item" items="${items}">
...



> -----Original Message-----
> From: Philippe Petit [mailto:philippe.petit@noos.fr]
> Sent: Friday, February 21, 2003 4:33 AM
> To: Tag Libraries Users List; vernonw@gatewaytech.com
> Subject: Re: simple question
>
>
> Thanks to Hans I got my button working as well, but I have no idea for the
> upload button...
> I'm facing another issue with tag encapsulation, I'm not able to have a
> forEach tag use a fmt tag for its items value :
> <select name="foo">
>
> <c:forEach var="item" items="<fmt:message key=\"org.type\"
> bundle=\"${lang}\"/>">
>
> <option value="<c:out value="${item}"/>" ><c:out
> value="${item}"/></option>
>
> </c:forEach>
>
> </select>
>
> I tried with and without quotes, etc and its not working... Any help is
> welcome
>
> Regards
> Cordialement
>
> ----- Original Message -----
> From: "Vernon Wu" <ve...@gatewaytech.com>
> To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
> Cc: <ha...@gefionsoftware.com>
> Sent: Thursday, February 20, 2003 5:54 PM
> Subject: Re: simple question
>
>
> >
> > I have internationalized all buttons in my project successfully using
> JSTL, except the file up load button. Any
> > suggestions on having a internationalization label on a file upload
> button?
> >
> >
> > Thanks,
> >
> > Vernon
> >
> > 17/02/2003 10:30:07 AM, Hans Bergsten <ha...@gefionsoftware.com> wrote:
> >
> > >Philippe Petit wrote:
> > >> Howto internationalize the labels of buttons
> > >> is it possible or not to nest tags this way : <input type="submit"
> > >> name="ListOrg" Value="<fmt:message
> > >> key=\"org.menu.btn.list\" bundle=\"${nav}\"/>" >
> > >> and if not, what are the interests of JSTL if we have to go
> back to JSP
> > >> expressions, or scriptlets so often, and if the use of tags needs
> > >> development skills?
> > >> is it "really" a decoupling between logic and presentation ?
> I doubt...
> > >
> > >What you're trying to do works fine, except that there's no need to
> > >escape the quotes around the <fmt:message> attributes (that actually
> > >causes the problem you most likely experience).
> > >
> > >The key is to realize that the <input> element is not seen as an
> > >element at all by the JSP container; it's just "template text", since
> > >the JSP container doesn't know anything about HTML. So your example
> > >should look like this:
> > >
> > >   <input type="submit" name="ListOrg"
> > >     value="<fmt:message key="org.menu.btn.list" bundle="${nav}"/>" >
> > >
> > >Again, since the container regards the HTML <input> element as any ol'
> > >template text, this is no different than this as far as it's concerned:
> > >
> > >   foo <fmt:message key="org.menu.btn.list" bundle="${nav}"/> bar
> > >
> > >It's just to us poor humans it looks confusing ;-)
> > >
> > >Hans
> > >--
> > >Hans Bergsten                                <ha...@gefionsoftware.com>
> > >Gefion Software                       <http://www.gefionsoftware.com/>
> > >Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
> > >Details at                                    <http://TheJSPBook.com/>
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> > >For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>
>


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


Re: simple question

Posted by Philippe Petit <ph...@noos.fr>.
Thanks to Hans I got my button working as well, but I have no idea for the
upload button...
I'm facing another issue with tag encapsulation, I'm not able to have a
forEach tag use a fmt tag for its items value :
<select name="foo">

<c:forEach var="item" items="<fmt:message key=\"org.type\"
bundle=\"${lang}\"/>">

<option value="<c:out value="${item}"/>" ><c:out value="${item}"/></option>

</c:forEach>

</select>

I tried with and without quotes, etc and its not working... Any help is
welcome

Regards
Cordialement

----- Original Message -----
From: "Vernon Wu" <ve...@gatewaytech.com>
To: "Tag Libraries Users List" <ta...@jakarta.apache.org>
Cc: <ha...@gefionsoftware.com>
Sent: Thursday, February 20, 2003 5:54 PM
Subject: Re: simple question


>
> I have internationalized all buttons in my project successfully using
JSTL, except the file up load button. Any
> suggestions on having a internationalization label on a file upload
button?
>
>
> Thanks,
>
> Vernon
>
> 17/02/2003 10:30:07 AM, Hans Bergsten <ha...@gefionsoftware.com> wrote:
>
> >Philippe Petit wrote:
> >> Howto internationalize the labels of buttons
> >> is it possible or not to nest tags this way : <input type="submit"
> >> name="ListOrg" Value="<fmt:message
> >> key=\"org.menu.btn.list\" bundle=\"${nav}\"/>" >
> >> and if not, what are the interests of JSTL if we have to go back to JSP
> >> expressions, or scriptlets so often, and if the use of tags needs
> >> development skills?
> >> is it "really" a decoupling between logic and presentation ? I doubt...
> >
> >What you're trying to do works fine, except that there's no need to
> >escape the quotes around the <fmt:message> attributes (that actually
> >causes the problem you most likely experience).
> >
> >The key is to realize that the <input> element is not seen as an
> >element at all by the JSP container; it's just "template text", since
> >the JSP container doesn't know anything about HTML. So your example
> >should look like this:
> >
> >   <input type="submit" name="ListOrg"
> >     value="<fmt:message key="org.menu.btn.list" bundle="${nav}"/>" >
> >
> >Again, since the container regards the HTML <input> element as any ol'
> >template text, this is no different than this as far as it's concerned:
> >
> >   foo <fmt:message key="org.menu.btn.list" bundle="${nav}"/> bar
> >
> >It's just to us poor humans it looks confusing ;-)
> >
> >Hans
> >--
> >Hans Bergsten                                <ha...@gefionsoftware.com>
> >Gefion Software                       <http://www.gefionsoftware.com/>
> >Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
> >Details at                                    <http://TheJSPBook.com/>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>


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


Re: simple question

Posted by Vernon Wu <ve...@gatewaytech.com>.
I have internationalized all buttons in my project successfully using JSTL, except the file up load button. Any 
suggestions on having a internationalization label on a file upload button?


Thanks,

Vernon
 
17/02/2003 10:30:07 AM, Hans Bergsten <ha...@gefionsoftware.com> wrote:

>Philippe Petit wrote:
>> Howto internationalize the labels of buttons
>> is it possible or not to nest tags this way : <input type="submit"
>> name="ListOrg" Value="<fmt:message
>> key=\"org.menu.btn.list\" bundle=\"${nav}\"/>" >
>> and if not, what are the interests of JSTL if we have to go back to JSP
>> expressions, or scriptlets so often, and if the use of tags needs
>> development skills?
>> is it "really" a decoupling between logic and presentation ? I doubt...
>
>What you're trying to do works fine, except that there's no need to
>escape the quotes around the <fmt:message> attributes (that actually
>causes the problem you most likely experience).
>
>The key is to realize that the <input> element is not seen as an
>element at all by the JSP container; it's just "template text", since
>the JSP container doesn't know anything about HTML. So your example
>should look like this:
>
>   <input type="submit" name="ListOrg"
>     value="<fmt:message key="org.menu.btn.list" bundle="${nav}"/>" >
>
>Again, since the container regards the HTML <input> element as any ol'
>template text, this is no different than this as far as it's concerned:
>
>   foo <fmt:message key="org.menu.btn.list" bundle="${nav}"/> bar
>
>It's just to us poor humans it looks confusing ;-)
>
>Hans
>-- 
>Hans Bergsten                                <ha...@gefionsoftware.com>
>Gefion Software                       <http://www.gefionsoftware.com/>
>Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
>Details at                                    <http://TheJSPBook.com/>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>




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


Re: simple question

Posted by Hans Bergsten <ha...@gefionsoftware.com>.
Philippe Petit wrote:
> Howto internationalize the labels of buttons
> is it possible or not to nest tags this way : <input type="submit"
> name="ListOrg" Value="<fmt:message
> key=\"org.menu.btn.list\" bundle=\"${nav}\"/>" >
> and if not, what are the interests of JSTL if we have to go back to JSP
> expressions, or scriptlets so often, and if the use of tags needs
> development skills?
> is it "really" a decoupling between logic and presentation ? I doubt...

What you're trying to do works fine, except that there's no need to
escape the quotes around the <fmt:message> attributes (that actually
causes the problem you most likely experience).

The key is to realize that the <input> element is not seen as an
element at all by the JSP container; it's just "template text", since
the JSP container doesn't know anything about HTML. So your example
should look like this:

   <input type="submit" name="ListOrg"
     value="<fmt:message key="org.menu.btn.list" bundle="${nav}"/>" >

Again, since the container regards the HTML <input> element as any ol'
template text, this is no different than this as far as it's concerned:

   foo <fmt:message key="org.menu.btn.list" bundle="${nav}"/> bar

It's just to us poor humans it looks confusing ;-)

Hans
-- 
Hans Bergsten                                <ha...@gefionsoftware.com>
Gefion Software                       <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at                                    <http://TheJSPBook.com/>


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