You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Frank W. Zammetti" <fz...@omnytex.com> on 2005/11/22 20:50:33 UTC

JSTL messages problem

Hello... I'm trying to display messages from a bundle using JSTL like so:

<fmt:message key="messages.appTitle" />

This isn't working, I'm getting:

???messages.appTitle???

However, doing:

<bean:message key="messages.appTitle"/>

Working fine.  So I know the key is correct, and the bundle is being read,
etc.  I admit I haven't done much with JSTL, but this seems pretty simple.
 Do I need to do any other kind of setup to tell the JSTL tags about the
bundle?  Thanks!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

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


Re: JSTL messages problem

Posted by Rahul Akolkar <ra...@gmail.com>.
On 11/22/05, Wendy Smoak <ws...@gmail.com> wrote:
> On 11/22/05, Rahul Akolkar <ra...@gmail.com> wrote:
> > On 11/22/05, Nick Sophinos <ni...@gmail.com> wrote:
>
> > This is definitely not how JSTL recommends loading bundles (see
> > fmt:bundle and fmt:setBundle). Ofcourse, its your decision.
>
> Can you explain more about this?
<snip/>

Ofcourse. I think Frank also asked a similar question, though the top
posting in that email might have thrown me off.


>  I'm also using the context
> parameter, and I only have the one .properties file, the app has no
> need for i18n.
>
<snap/>

It boils down to what a technology *expects* the casual users to know.
The param-name is merely an implementation detail (though the spec
talks about it so its guaranteed to be the same name in all JSTL
impls). Its similar to the casual user not needing to know that a
Struts module is "loaded" under the attribute name Globals.MODULE_KEY
+ prefix.

In addition, as you've noted, this approach mandates the app use a
single basename bundle.


> It looks like fmt:setBundle would be done on each page, so I'm not
> sure what I'd gain from it.
>
<snip/>

Why on every page?

-Rahul


> Thanks,
> --
> Wendy
>

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


Re: JSTL messages problem

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/22/05, Rahul Akolkar <ra...@gmail.com> wrote:
> On 11/22/05, Nick Sophinos <ni...@gmail.com> wrote:

> This is definitely not how JSTL recommends loading bundles (see
> fmt:bundle and fmt:setBundle). Ofcourse, its your decision.

Can you explain more about this?  I'm also using the context
parameter, and I only have the one .properties file, the app has no
need for i18n.

It looks like fmt:setBundle would be done on each page, so I'm not
sure what I'd gain from it.

Thanks,
--
Wendy

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


Re: JSTL messages problem

Posted by Rahul Akolkar <ra...@gmail.com>.
On 11/22/05, Nick Sophinos <ni...@gmail.com> wrote:
> Place this in your web.xml file:
>
> <context-param>
> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
> <param-value>com.omnytext.blah.blah.properties.ApplicationResources
> </param-value>
> </context-param>
>
> Where ApplicationResources.properties is the name of the message bundle in
> question.
>
<snip/>

<exclamation-mark/>

This is definitely not how JSTL recommends loading bundles (see
fmt:bundle and fmt:setBundle). Ofcourse, its your decision.

-Rahul



> - Nick
>
> On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
> >
> > Hello... I'm trying to display messages from a bundle using JSTL like so:
> >
> > <fmt:message key="messages.appTitle" />
> >
> > This isn't working, I'm getting:
> >
> > ???messages.appTitle???
> >
> > However, doing:
> >
> > <bean:message key="messages.appTitle"/>
> >
> > Working fine. So I know the key is correct, and the bundle is being read,
> > etc. I admit I haven't done much with JSTL, but this seems pretty simple.
> > Do I need to do any other kind of setup to tell the JSTL tags about the
> > bundle? Thanks!
> >
> > --
> > Frank W. Zammetti
> > Founder and Chief Software Architect
> > Omnytex Technologies
> > http://www.omnytex.com
> > AIM: fzammetti
> > Yahoo: fzammetti
> > MSN: fzammetti@hotmail.com
> >

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


Re: JSTL messages problem

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Yep, just figured that out myself :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

On Tue, November 22, 2005 3:27 pm, Wendy Smoak said:
> On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>
>> I added this but it still didn't work... One thing that didn't make
>> sense
>> to me is that I have app_resources_en.properties in WEB-INF/classes, so
>> I
>> wasn't sure how to qualify that in a package structure, so I just put
>> <param-value>app_resources.properties</param-value>... is that right or
>> am
>> I misunderstanding something?  Thanks again!
>
> Leave off the '.properties' in the <param-value>.  Other than that, yes.
>
> --
> Wendy
> http://wiki.wsmoak.net/cgi-bin/wiki.pl?StrutsMessagesAndJSTL
>
> ---------------------------------------------------------------------
> 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


Re: JSTL messages problem

Posted by Laurie Harper <la...@holoweb.net>.
Well, I said this was the gereral solution ;-) But yes, I forgot about 
that, which makes things that bit simpler for this case.

L.

Rahul Akolkar wrote:
> On 11/22/05, Laurie Harper <la...@holoweb.net> wrote:
> 
>>For the record, here's the general solution as well, for situations
>>where you can't use the element body like that. First, defining a
>>scripting variable:
>>
>>  <c:set var="msg"><fmt:message key="msg.key"/></c:set>
> 
> <snip/>
> 
> http://marc.theaimsgroup.com/?l=struts-user&m=113269509808314&w=2
> 
> -Rahul
> 
> 
> 
>>  <x:yyy ... attr="${msg}"/>
>>
>>Or, to avoid the scripting variable, you can use jsp:attribute:
>>
>>  <c:yyy ...>
>>    <jsp:attribute name="attr">
>>      <fmt:message key="msg.key"/>
>>    </jsp:attribute>
>>  </c:yyy>
>>
>>This comes up on the list so often, I think I'll add an FAQ page to the
>>wiki :-)
>>
>>L.
>>
>>Ed Griebel wrote:
>>
>>>I use this idiom all the time to get a message label on a button:
>>>      <html:submit property="button" styleClass="longButton">
>>>              <bean:message key="button.confirm"/>
>>>      </html:submit>
>>>
>>>You should be able to substitute <fmt:message> above.
>>>
>>>-ed
>>>
>>>
>>>On 11/22/05, Wendy Smoak <ws...@gmail.com> wrote:
>>>
>>>
>>>>On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>>>>
>>>>
>>>>>Ok, today is apparently the day I get to ask a bunch of stupid questions...
>>>>>
>>>>>Why doesn't this work?
>>>>>
>>>>><html:submit styleClass="cssButton" value="<fmt:message
>>>>>key="labels.loginButton" />" />
>>>>
>>>>You can't use a JSP tag as attribute of another JSP tag.
>>>>
>>>>Maybe try <c:set> with the fmt in the body, then use an expression for
>>>>the value of <html:submit>?   Which implies the use of the Struts-EL
>>>>taglib, which you should be using if you're on Servlet 2.3/JSTL 1.0.
>>>>
>>>>If you haven't already, change the URI in <%@ taglib> and leave the
>>>>prefix as 'html'.
>>>>
>>>>--
>>>>Wendy
>>>>


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


Re: JSTL messages problem

Posted by Rahul Akolkar <ra...@gmail.com>.
On 11/22/05, Laurie Harper <la...@holoweb.net> wrote:
> For the record, here's the general solution as well, for situations
> where you can't use the element body like that. First, defining a
> scripting variable:
>
>   <c:set var="msg"><fmt:message key="msg.key"/></c:set>
<snip/>

http://marc.theaimsgroup.com/?l=struts-user&m=113269509808314&w=2

-Rahul


>   <x:yyy ... attr="${msg}"/>
>
> Or, to avoid the scripting variable, you can use jsp:attribute:
>
>   <c:yyy ...>
>     <jsp:attribute name="attr">
>       <fmt:message key="msg.key"/>
>     </jsp:attribute>
>   </c:yyy>
>
> This comes up on the list so often, I think I'll add an FAQ page to the
> wiki :-)
>
> L.
>
> Ed Griebel wrote:
> > I use this idiom all the time to get a message label on a button:
> >       <html:submit property="button" styleClass="longButton">
> >               <bean:message key="button.confirm"/>
> >       </html:submit>
> >
> > You should be able to substitute <fmt:message> above.
> >
> > -ed
> >
> >
> > On 11/22/05, Wendy Smoak <ws...@gmail.com> wrote:
> >
> >>On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
> >>
> >>>Ok, today is apparently the day I get to ask a bunch of stupid questions...
> >>>
> >>>Why doesn't this work?
> >>>
> >>><html:submit styleClass="cssButton" value="<fmt:message
> >>>key="labels.loginButton" />" />
> >>
> >>You can't use a JSP tag as attribute of another JSP tag.
> >>
> >>Maybe try <c:set> with the fmt in the body, then use an expression for
> >>the value of <html:submit>?   Which implies the use of the Struts-EL
> >>taglib, which you should be using if you're on Servlet 2.3/JSTL 1.0.
> >>
> >>If you haven't already, change the URI in <%@ taglib> and leave the
> >>prefix as 'html'.
> >>
> >>--
> >>Wendy
> >>

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


Re: JSTL messages problem

Posted by Laurie Harper <la...@holoweb.net>.
For the record, here's the general solution as well, for situations 
where you can't use the element body like that. First, defining a 
scripting variable:

   <c:set var="msg"><fmt:message key="msg.key"/></c:set>
   <x:yyy ... attr="${msg}"/>

Or, to avoid the scripting variable, you can use jsp:attribute:

   <c:yyy ...>
     <jsp:attribute name="attr">
       <fmt:message key="msg.key"/>
     </jsp:attribute>
   </c:yyy>

This comes up on the list so often, I think I'll add an FAQ page to the 
wiki :-)

L.

Ed Griebel wrote:
> I use this idiom all the time to get a message label on a button:
> 	<html:submit property="button" styleClass="longButton">
> 		<bean:message key="button.confirm"/>
> 	</html:submit>
> 
> You should be able to substitute <fmt:message> above.
> 
> -ed
> 
> 
> On 11/22/05, Wendy Smoak <ws...@gmail.com> wrote:
> 
>>On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>>
>>>Ok, today is apparently the day I get to ask a bunch of stupid questions...
>>>
>>>Why doesn't this work?
>>>
>>><html:submit styleClass="cssButton" value="<fmt:message
>>>key="labels.loginButton" />" />
>>
>>You can't use a JSP tag as attribute of another JSP tag.
>>
>>Maybe try <c:set> with the fmt in the body, then use an expression for
>>the value of <html:submit>?   Which implies the use of the Struts-EL
>>taglib, which you should be using if you're on Servlet 2.3/JSTL 1.0.
>>
>>If you haven't already, change the URI in <%@ taglib> and leave the
>>prefix as 'html'.
>>
>>--
>>Wendy
>>
>>---------------------------------------------------------------------
>>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


Re: JSTL messages problem

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/22/05, Ed Griebel <ed...@gmail.com> wrote:
> I use this idiom all the time to get a message label on a button:
>         <html:submit property="button" styleClass="longButton">
>                 <bean:message key="button.confirm"/>
>         </html:submit>
>
> You should be able to substitute <fmt:message> above.

What he said. :)  I had to go look around the source code of an old
project to refresh my memory and was about to post a similar example. 
Too much BASIC, not enough Java, lately...

--
Wendy

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


Re: JSTL messages problem

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
I admit I always forget the <button> and <submit> elements, among others,
support body text.  Had I remembered that I would have come up with this
on my own :)  But thanks Ed (and Wendy after the fact ;) ), that worked
perfectly.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

On Tue, November 22, 2005 4:21 pm, Ed Griebel said:
> I use this idiom all the time to get a message label on a button:
> 	<html:submit property="button" styleClass="longButton">
> 		<bean:message key="button.confirm"/>
> 	</html:submit>
>
> You should be able to substitute <fmt:message> above.
>
> -ed
>
>
> On 11/22/05, Wendy Smoak <ws...@gmail.com> wrote:
>> On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>> > Ok, today is apparently the day I get to ask a bunch of stupid
>> questions...
>> >
>> > Why doesn't this work?
>> >
>> > <html:submit styleClass="cssButton" value="<fmt:message
>> > key="labels.loginButton" />" />
>>
>> You can't use a JSP tag as attribute of another JSP tag.
>>
>> Maybe try <c:set> with the fmt in the body, then use an expression for
>> the value of <html:submit>?   Which implies the use of the Struts-EL
>> taglib, which you should be using if you're on Servlet 2.3/JSTL 1.0.
>>
>> If you haven't already, change the URI in <%@ taglib> and leave the
>> prefix as 'html'.
>>
>> --
>> Wendy
>>
>> ---------------------------------------------------------------------
>> 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
>
>


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


Re: JSTL messages problem

Posted by Ed Griebel <ed...@gmail.com>.
I use this idiom all the time to get a message label on a button:
	<html:submit property="button" styleClass="longButton">
		<bean:message key="button.confirm"/>
	</html:submit>

You should be able to substitute <fmt:message> above.

-ed


On 11/22/05, Wendy Smoak <ws...@gmail.com> wrote:
> On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
> > Ok, today is apparently the day I get to ask a bunch of stupid questions...
> >
> > Why doesn't this work?
> >
> > <html:submit styleClass="cssButton" value="<fmt:message
> > key="labels.loginButton" />" />
>
> You can't use a JSP tag as attribute of another JSP tag.
>
> Maybe try <c:set> with the fmt in the body, then use an expression for
> the value of <html:submit>?   Which implies the use of the Struts-EL
> taglib, which you should be using if you're on Servlet 2.3/JSTL 1.0.
>
> If you haven't already, change the URI in <%@ taglib> and leave the
> prefix as 'html'.
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> 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


Re: JSTL messages problem

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Yes, I saw those tags as I was researching, wasn't sure how to use them
though... is there a good reason to use them over the context param (or
vice-versa)?  I would personally think the context param would be better
as it would be more global and would cut down on some tags on the page...
also, will those tags override the context param if that's what one wants?

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

On Tue, November 22, 2005 4:31 pm, Rahul Akolkar said:
> On 11/22/05, Wendy Smoak <ws...@gmail.com> wrote:
>> On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>> > Ok, today is apparently the day I get to ask a bunch of stupid
>> questions...
>> >
>> > Why doesn't this work?
>> >
>> > <html:submit styleClass="cssButton" value="<fmt:message
>> > key="labels.loginButton" />" />
>>
>> You can't use a JSP tag as attribute of another JSP tag.
>>
>> Maybe try <c:set> with the fmt in the body, then use an expression for
>> the value of <html:submit>?
> <snip/>
>
> fmt:message has a var/scope tuple for this purpose.
>
> -Rahul
>
>
>>Which implies the use of the Struts-EL
>> taglib, which you should be using if you're on Servlet 2.3/JSTL 1.0.
>>
>> If you haven't already, change the URI in <%@ taglib> and leave the
>> prefix as 'html'.
>>
>> --
>> Wendy
>>
>
> ---------------------------------------------------------------------
> 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


Re: JSTL messages problem

Posted by Rahul Akolkar <ra...@gmail.com>.
On 11/22/05, Wendy Smoak <ws...@gmail.com> wrote:
> On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
> > Ok, today is apparently the day I get to ask a bunch of stupid questions...
> >
> > Why doesn't this work?
> >
> > <html:submit styleClass="cssButton" value="<fmt:message
> > key="labels.loginButton" />" />
>
> You can't use a JSP tag as attribute of another JSP tag.
>
> Maybe try <c:set> with the fmt in the body, then use an expression for
> the value of <html:submit>?
<snip/>

fmt:message has a var/scope tuple for this purpose.

-Rahul


>Which implies the use of the Struts-EL
> taglib, which you should be using if you're on Servlet 2.3/JSTL 1.0.
>
> If you haven't already, change the URI in <%@ taglib> and leave the
> prefix as 'html'.
>
> --
> Wendy
>

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


Re: JSTL messages problem

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
> Ok, today is apparently the day I get to ask a bunch of stupid questions...
>
> Why doesn't this work?
>
> <html:submit styleClass="cssButton" value="<fmt:message
> key="labels.loginButton" />" />

You can't use a JSP tag as attribute of another JSP tag.

Maybe try <c:set> with the fmt in the body, then use an expression for
the value of <html:submit>?   Which implies the use of the Struts-EL
taglib, which you should be using if you're on Servlet 2.3/JSTL 1.0.

If you haven't already, change the URI in <%@ taglib> and leave the
prefix as 'html'.

--
Wendy

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


Re: JSTL messages problem

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Ok, today is apparently the day I get to ask a bunch of stupid questions...

Why doesn't this work?

<html:submit styleClass="cssButton" value="<fmt:message
key="labels.loginButton" />" />

I get...

org.apache.jasper.JasperException: /index.jsp(36,83) equal symbol expected

...when I try it.  <bean:message> doesn't work either... it's obviously a
problem with embedding one taq in another, so I guess my quesion really is
how does one label a submit button with a message from a bundle in
general?  I've done this in the past, but I've never tried it from within
an <html:submit>, always a plain HTML <input> element, so it wasn't a
nested custom tag.  Thanks!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

On Tue, November 22, 2005 3:27 pm, Wendy Smoak said:
> On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>
>> I added this but it still didn't work... One thing that didn't make
>> sense
>> to me is that I have app_resources_en.properties in WEB-INF/classes, so
>> I
>> wasn't sure how to qualify that in a package structure, so I just put
>> <param-value>app_resources.properties</param-value>... is that right or
>> am
>> I misunderstanding something?  Thanks again!
>
> Leave off the '.properties' in the <param-value>.  Other than that, yes.
>
> --
> Wendy
> http://wiki.wsmoak.net/cgi-bin/wiki.pl?StrutsMessagesAndJSTL
>
> ---------------------------------------------------------------------
> 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


Re: JSTL messages problem

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:

> I added this but it still didn't work... One thing that didn't make sense
> to me is that I have app_resources_en.properties in WEB-INF/classes, so I
> wasn't sure how to qualify that in a package structure, so I just put
> <param-value>app_resources.properties</param-value>... is that right or am
> I misunderstanding something?  Thanks again!

Leave off the '.properties' in the <param-value>.  Other than that, yes.

--
Wendy
http://wiki.wsmoak.net/cgi-bin/wiki.pl?StrutsMessagesAndJSTL

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


Re: JSTL messages problem

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Ah, I got it!  The parameter should have been app_resources WITHOUT the
.properties.  Now it works.  Thanks Nick, I appreciate your time!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

On Tue, November 22, 2005 3:20 pm, Frank W. Zammetti said:
> Hi Nick,
>
> I added this but it still didn't work... One thing that didn't make sense
> to me is that I have app_resources_en.properties in WEB-INF/classes, so I
> wasn't sure how to qualify that in a package structure, so I just put
> <param-value>app_resources.properties</param-value>... is that right or am
> I misunderstanding something?  Thanks again!
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM: fzammetti
> Yahoo: fzammetti
> MSN: fzammetti@hotmail.com
>
> On Tue, November 22, 2005 3:02 pm, Nick Sophinos said:
>> Place this in your web.xml file:
>>
>> <context-param>
>> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
>> <param-value>com.omnytext.blah.blah.properties.ApplicationResources
>> </param-value>
>> </context-param>
>>
>> Where ApplicationResources.properties is the name of the message bundle
>> in
>> question.
>>
>> - Nick
>>
>> On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>>>
>>> Hello... I'm trying to display messages from a bundle using JSTL like
>>> so:
>>>
>>> <fmt:message key="messages.appTitle" />
>>>
>>> This isn't working, I'm getting:
>>>
>>> ???messages.appTitle???
>>>
>>> However, doing:
>>>
>>> <bean:message key="messages.appTitle"/>
>>>
>>> Working fine. So I know the key is correct, and the bundle is being
>>> read,
>>> etc. I admit I haven't done much with JSTL, but this seems pretty
>>> simple.
>>> Do I need to do any other kind of setup to tell the JSTL tags about the
>>> bundle? Thanks!
>>>
>>> --
>>> Frank W. Zammetti
>>> Founder and Chief Software Architect
>>> Omnytex Technologies
>>> http://www.omnytex.com
>>> AIM: fzammetti
>>> Yahoo: fzammetti
>>> MSN: fzammetti@hotmail.com
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
>


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


Re: JSTL messages problem

Posted by "Frank W. Zammetti" <fz...@omnytex.com>.
Hi Nick,

I added this but it still didn't work... One thing that didn't make sense
to me is that I have app_resources_en.properties in WEB-INF/classes, so I
wasn't sure how to qualify that in a package structure, so I just put
<param-value>app_resources.properties</param-value>... is that right or am
I misunderstanding something?  Thanks again!

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

On Tue, November 22, 2005 3:02 pm, Nick Sophinos said:
> Place this in your web.xml file:
>
> <context-param>
> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
> <param-value>com.omnytext.blah.blah.properties.ApplicationResources
> </param-value>
> </context-param>
>
> Where ApplicationResources.properties is the name of the message bundle in
> question.
>
> - Nick
>
> On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>>
>> Hello... I'm trying to display messages from a bundle using JSTL like
>> so:
>>
>> <fmt:message key="messages.appTitle" />
>>
>> This isn't working, I'm getting:
>>
>> ???messages.appTitle???
>>
>> However, doing:
>>
>> <bean:message key="messages.appTitle"/>
>>
>> Working fine. So I know the key is correct, and the bundle is being
>> read,
>> etc. I admit I haven't done much with JSTL, but this seems pretty
>> simple.
>> Do I need to do any other kind of setup to tell the JSTL tags about the
>> bundle? Thanks!
>>
>> --
>> Frank W. Zammetti
>> Founder and Chief Software Architect
>> Omnytex Technologies
>> http://www.omnytex.com
>> AIM: fzammetti
>> Yahoo: fzammetti
>> MSN: fzammetti@hotmail.com
>>
>> ---------------------------------------------------------------------
>> 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


Re: JSTL messages problem

Posted by Nick Sophinos <ni...@gmail.com>.
Place this in your web.xml file:

<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<param-value>com.omnytext.blah.blah.properties.ApplicationResources
</param-value>
</context-param>

Where ApplicationResources.properties is the name of the message bundle in
question.

- Nick

On 11/22/05, Frank W. Zammetti <fz...@omnytex.com> wrote:
>
> Hello... I'm trying to display messages from a bundle using JSTL like so:
>
> <fmt:message key="messages.appTitle" />
>
> This isn't working, I'm getting:
>
> ???messages.appTitle???
>
> However, doing:
>
> <bean:message key="messages.appTitle"/>
>
> Working fine. So I know the key is correct, and the bundle is being read,
> etc. I admit I haven't done much with JSTL, but this seems pretty simple.
> Do I need to do any other kind of setup to tell the JSTL tags about the
> bundle? Thanks!
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
> AIM: fzammetti
> Yahoo: fzammetti
> MSN: fzammetti@hotmail.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>