You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Celinio Fernandes <ce...@yahoo.com> on 2008/12/28 10:44:31 UTC
Message properties not displaying
Hi,
I am trying to display a label using messages in a property file src/global-messages.properties :
personBean.firstName=Your first name
(The default locale i am using is en_US)
In struts.xml i declared it :
<constant name="struts.custom.i18n.resources" value="global-messages" />
In a JSP i try do display a label :
<s:label key="personBean.firstName" />
The HTML code generated is :
<label id="personBean_firstName"></label>
The text is missing.
Does anyone have an idea what the problem might be ?
Thanks
RE: Message properties not displaying
Posted by Celinio Fernandes <ce...@yahoo.com>.
Thanks.
I have a problem now with the rendering of the page, due to the inclusion of the XHTML theme.
Here's the main code of my JSP :
<s:form action ="addArticle" >
<table bgcolor="#50AFAF" border="1" >
<center>
<tr><td> <s:label value="Article ID :" /></td> <td> <s:property value="#session.monArticle.articleid" /> </td></tr>
<tr><td> <s:label value="Produit:" /> </td> <td> <s:property value="#session.monArticle.produitFk.nom" /> </td></tr>
<tr><td> <s:label value="Nom :" /> </td> <td> <s:property value="#session.monArticle.nom" /> </td></tr>
<tr><td> <s:label value="Prix :" /> </td> <td> <s:property value="#session.monArticle.prix" /> </td></tr>
<tr><td> <s:label value="Stock :" /> </td> <td> <s:property value="#session.monArticle.stockFK.quantite" /> </td></tr>
<tr><td> <s:label key="visualiser.quantite" theme="xhtml" /></td> <td> <s:textfield name="quantite" size="20" value="1" /> </td> </tr>
</center>
</table>
<br/>
<center><s:submit name="addC" value="ADD" ></s:submit> </center>
</s:form>
I tried to use the theme XHTML for all the tags in that JSP, but the rendering is aweful.
If i remove the <table>, <tr>, <td> html tags it is better but then i have a problem with the rendering of the <s:property> tags.
Is there a way to include a label in the <s:property ..> tag ?
My theme by default is simple as i have defined it in a struts.properties file :
struts.ui.theme=simple
Thanks for helping me sorting it out.
--- On Tue, 12/30/08, Martin Gainty <mg...@hotmail.com> wrote:
From: Martin Gainty <mg...@hotmail.com>
Subject: RE: Message properties not displaying
To: "Struts Users Mailing List" <us...@struts.apache.org>, gordianyuan@gmail.com
Date: Tuesday, December 30, 2008, 1:18 PM
you have to change the characteristics of all the Struts Tags to use either
theme="xhtml" for ajax enabled
OR
theme="simple" for regular tags
The same Struts tags use different attributes for XHTML vs Simple variations
If you post the contents of jsp (and tlds) and we can walk you thru it..
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business
of Sender. This transmission is of a confidential nature and Sender does not
endorse distribution to any party other than intended recipient. Sender does not
necessarily endorse content contained within this transmission.
> Date: Tue, 30 Dec 2008 10:36:03 -0800
> From: cel975@yahoo.com
> Subject: Re: Message properties not displaying
> To: gordianyuan@gmail.com; user@struts.apache.org
>
> hey Gordian Yuan,
> you were right.
>
> In struts.properties i set struts.ui.theme=simple
>
> In my JSP, if i use the theme xhtml, like this:
> <s:label key="personBean.firstName" theme="xhtml"
/>
> then it works.
>
> What does it mean ?
> Messages are not displayed with the SIMPLE theme ?
>
> Thanks
>
> --- On Mon, 12/29/08, Gordian Yuan <go...@gmail.com> wrote:
> From: Gordian Yuan <go...@gmail.com>
> Subject: Re: Message properties not displaying
> To: "Struts Users Mailing List" <us...@struts.apache.org>,
cel975@yahoo.com
> Date: Monday, December 29, 2008, 10:26 PM
>
> Hi, Celinio
> do you declare
> <constant name="struts.ui.theme" value="simple"
/>
> or
> <s:from theme="simple"></s:from> ?
>
> you can simple try <s:label key="personBean.firstName"
theme="xhtml" />
>
> On Sun, Dec 28, 2008 at 5:44 PM, Celinio Fernandes
<ce...@yahoo.com> wrote:
>
> Hi,
>
> I am trying to display a label using messages in a property file
src/global-messages.properties :
>
> personBean.firstName=Your first name
>
>
>
> (The default locale i am using is en_US)
>
>
>
> In struts.xml i declared it :
>
> <constant name="struts.custom.i18n.resources"
value="global-messages" />
>
>
>
> In a JSP i try do display a label :
>
>
>
> <s:label key="personBean.firstName" />
>
>
>
> The HTML code generated is :
>
> <label id="personBean_firstName"></label>
>
> The text is missing.
>
>
>
> Does anyone have an idea what the problem might be ?
>
> Thanks
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
_________________________________________________________________
Life on your PC is safer, easier, and more enjoyable with Windows Vista®.
http://clk.atdmt.com/MRT/go/127032870/direct/01/
RE: Message properties not displaying
Posted by Martin Gainty <mg...@hotmail.com>.
you have to change the characteristics of all the Struts Tags to use either
theme="xhtml" for ajax enabled
OR
theme="simple" for regular tags
The same Struts tags use different attributes for XHTML vs Simple variations
If you post the contents of jsp (and tlds) and we can walk you thru it..
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.
> Date: Tue, 30 Dec 2008 10:36:03 -0800
> From: cel975@yahoo.com
> Subject: Re: Message properties not displaying
> To: gordianyuan@gmail.com; user@struts.apache.org
>
> hey Gordian Yuan,
> you were right.
>
> In struts.properties i set struts.ui.theme=simple
>
> In my JSP, if i use the theme xhtml, like this:
> <s:label key="personBean.firstName" theme="xhtml" />
> then it works.
>
> What does it mean ?
> Messages are not displayed with the SIMPLE theme ?
>
> Thanks
>
> --- On Mon, 12/29/08, Gordian Yuan <go...@gmail.com> wrote:
> From: Gordian Yuan <go...@gmail.com>
> Subject: Re: Message properties not displaying
> To: "Struts Users Mailing List" <us...@struts.apache.org>, cel975@yahoo.com
> Date: Monday, December 29, 2008, 10:26 PM
>
> Hi, Celinio
> do you declare
> <constant name="struts.ui.theme" value="simple" />
> or
> <s:from theme="simple"></s:from> ?
>
> you can simple try <s:label key="personBean.firstName" theme="xhtml" />
>
> On Sun, Dec 28, 2008 at 5:44 PM, Celinio Fernandes <ce...@yahoo.com> wrote:
>
> Hi,
>
> I am trying to display a label using messages in a property file src/global-messages.properties :
>
> personBean.firstName=Your first name
>
>
>
> (The default locale i am using is en_US)
>
>
>
> In struts.xml i declared it :
>
> <constant name="struts.custom.i18n.resources" value="global-messages" />
>
>
>
> In a JSP i try do display a label :
>
>
>
> <s:label key="personBean.firstName" />
>
>
>
> The HTML code generated is :
>
> <label id="personBean_firstName"></label>
>
> The text is missing.
>
>
>
> Does anyone have an idea what the problem might be ?
>
> Thanks
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
_________________________________________________________________
Life on your PC is safer, easier, and more enjoyable with Windows Vista®.
http://clk.atdmt.com/MRT/go/127032870/direct/01/
Re: Message properties not displaying
Posted by Celinio Fernandes <ce...@yahoo.com>.
hey Gordian Yuan,
you were right.
In struts.properties i set struts.ui.theme=simple
In my JSP, if i use the theme xhtml, like this:
<s:label key="personBean.firstName" theme="xhtml" />
then it works.
What does it mean ?
Messages are not displayed with the SIMPLE theme ?
Thanks
--- On Mon, 12/29/08, Gordian Yuan <go...@gmail.com> wrote:
From: Gordian Yuan <go...@gmail.com>
Subject: Re: Message properties not displaying
To: "Struts Users Mailing List" <us...@struts.apache.org>, cel975@yahoo.com
Date: Monday, December 29, 2008, 10:26 PM
Hi, Celinio
do you declare
<constant name="struts.ui.theme" value="simple" />
or
<s:from theme="simple"></s:from> ?
you can simple try <s:label key="personBean.firstName" theme="xhtml" />
On Sun, Dec 28, 2008 at 5:44 PM, Celinio Fernandes <ce...@yahoo.com> wrote:
Hi,
I am trying to display a label using messages in a property file src/global-messages.properties :
personBean.firstName=Your first name
(The default locale i am using is en_US)
In struts.xml i declared it :
<constant name="struts.custom.i18n.resources" value="global-messages" />
In a JSP i try do display a label :
<s:label key="personBean.firstName" />
The HTML code generated is :
<label id="personBean_firstName"></label>
The text is missing.
Does anyone have an idea what the problem might be ?
Thanks
Re: Message properties not displaying
Posted by taj uddin <ta...@yahoo.com>.
Hi,
Try using this code:
<s:label value="personBean.firstName" />
--- On Tue, 12/30/08, Gordian Yuan <go...@gmail.com> wrote:
From: Gordian Yuan <go...@gmail.com>
Subject: Re: Message properties not displaying
To: "Struts Users Mailing List" <us...@struts.apache.org>, cel975@yahoo.com
Date: Tuesday, December 30, 2008, 1:26 AM
Hi, Celinio
do you declare
<constant name="struts.ui.theme" value="simple" />
or
<s:from theme="simple"></s:from> ?
you can simple try <s:label key="personBean.firstName"
theme="xhtml" />
On Sun, Dec 28, 2008 at 5:44 PM, Celinio Fernandes <ce...@yahoo.com>
wrote:
> Hi,
> I am trying to display a label using messages in a property file
> src/global-messages.properties :
> personBean.firstName=Your first name
>
> (The default locale i am using is en_US)
>
> In struts.xml i declared it :
> <constant name="struts.custom.i18n.resources"
value="global-messages" />
>
> In a JSP i try do display a label :
>
> <s:label key="personBean.firstName" />
>
> The HTML code generated is :
> <label id="personBean_firstName"></label>
> The text is missing.
>
> Does anyone have an idea what the problem might be ?
> Thanks
>
>
>
>
>
>
Re: Message properties not displaying
Posted by Gordian Yuan <go...@gmail.com>.
Hi, Celinio
do you declare
<constant name="struts.ui.theme" value="simple" />
or
<s:from theme="simple"></s:from> ?
you can simple try <s:label key="personBean.firstName" theme="xhtml" />
On Sun, Dec 28, 2008 at 5:44 PM, Celinio Fernandes <ce...@yahoo.com> wrote:
> Hi,
> I am trying to display a label using messages in a property file
> src/global-messages.properties :
> personBean.firstName=Your first name
>
> (The default locale i am using is en_US)
>
> In struts.xml i declared it :
> <constant name="struts.custom.i18n.resources" value="global-messages" />
>
> In a JSP i try do display a label :
>
> <s:label key="personBean.firstName" />
>
> The HTML code generated is :
> <label id="personBean_firstName"></label>
> The text is missing.
>
> Does anyone have an idea what the problem might be ?
> Thanks
>
>
>
>
>
>