You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by bberken <bb...@mainstreamdata.com> on 2010/01/21 21:05:07 UTC

I'm having a problem w/the use of the <s:text/> tag in my application. My
setup is the following:

(struts 2.1.8.1)

I have one global resource bundle, defined in my struts.properties file:
struts.custom.i18n.resources=application

in my jsp I am outputting a label as follows:
<td><s:text name="header.form.video">Video</s:text></td>

the resource key 'header.form.video' is NOT defined in my
application.properties file, thus I expected the default value in the body
of the tags to be displayed : "Video"

However - I'm getting an empty string displayed, as opposed to my default
text. 

A similar <s:text call is made a few lines down in my jsp:
<td><s:text name="header.form.stories">Stories</s:text></td> and this does
display correctly (this key is also not defined in my .properties file, but
the default text "Stories" is displayed)

My action class does have a string property named 'video':
private String video = "";

and it does NOT have a 'stories' property

If I change the default text in my tag to:
<td><s:text name="header.form.video">Videos</s:text></td>, the default text
"Videos" is displayed, and if I initialize my action class's video property
to some value:
private String video = "test"; then the string 'test' is displayed in my
jsp.

It seems like struts is somehow evaluating the literal string default in the
body of my s:text tags - to something on the ValueStack (and doing it w/out
case sensitivity).

Am I not understanding the way the resource bundle key resolution works? 

This issue cropped up after an upgrade from struts 2.0.6 to 2.1.8.1 - If
anyone has any insight I'd appreciate it!


-- 
View this message in context: http://old.nabble.com/%3Cs%3Atext-tag-question-tp27263681p27263681.html
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