Here's what I've done:

<s:textfield name="company"/> 
<s:property value="fieldErrors['company'][0]"/>

IMO, <s:fielderror> should detect when there's only one error and emit no
<li> tags. I've entered an issue in JIRA for this:

https://issues.apache.org/struts/browse/WW-2090

On a related note, looking at the docs, it looks like you're required to use
<s:param> to specify the field name. Is this true, or can "name" be used for
that?

Thanks,

Matt


Petzsch, Martin wrote:
> 
> 
> Hi,
> 
> Short of modifying the template for s:fielderror is there a way to
> retrieve
> just the text of the error message on a JSP?
> 
> Even with the theme set to simple I get the following on my jsp:
> <ul><li>An Error Message</li></ul>
> 
> What I want is just the message:
> An Error Message
> 
> And then I am free to decorate it as I wish.
> 
> Equally if you think I am taking the wrong approach to this please let me
> know.  The goal is to just display an error message - to the right of the
> field and to decorate it with CSS classes of our choice.  Ending up with
> something like this:
> 
> <input type="text" name="myBean.name" value="" id="name"/>
> An Error Message
> 
> Many thanks!
> Martin
> 
> 
> Capgemini is a trading name used by the Capgemini Group of companies which
> includes Capgemini UK plc, a company registered in England and Wales
> (number 943935) whose registered office is at No. 1 Forge End, Woking,
> Surrey, GU21 6DB. 
> 
> 
> This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, 
> you are not authorized to read, print, retain, copy, disseminate, 
> distribute, or use this message or any part thereof. If you receive this 
> message in error, please notify the sender immediately and delete all 
> copies of this message.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Error-Message-display-tf4229431.html#a12038118
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to