Struts - nested messages

K

Konrad Billewicz

Hello,

I wish to nest one message inside another. I thought about something like:

ActionMessage msg = new ActionMessage
(
"error.field.notValid",
new
ActionMessage("form.treaty.field.agreementType"){.getValue()}
));

It isn't working because of the fact that method getValue() doesn't exists
in ActionMessage class. So, how to get value of the ActionMessage object
created with particular key? My messages are defined in
MessageResources.properties file.

Maybe I try do do it completely wrong?

Best regards,
Konrad Billewicz
 
W

Wendy Smoak

Konrad Billewicz said:
I wish to nest one message inside another. I thought about something like:
ActionMessage msg = new ActionMessage
(
"error.field.notValid",
new
ActionMessage("form.treaty.field.agreementType"){.getValue()}
));

Can you explain why you think you need to do this? And give an example of
the messages in (usually) ApplicationResources.properties and how they
"nest" to give you the output you're trying to achieve?

You're much better off posting your question to the Struts user list...
recent history shows that I'm the only one here answering Struts questions,
and there are dozens of people on struts-user just waiting to help. :)
http://struts.apache.org/mail.html
 
K

Konrad Billewicz

Can you explain why you think you need to do this? And give an example of
the messages in (usually) ApplicationResources.properties and how they
"nest" to give you the output you're trying to achieve?

I wish to nest a field name inside a pattern error message and output it
using <html:errors/>. For example:

// from MessageResources.properties
# -- form fields --
form.treaty.field.agreementType=Agreement Type
....
# -- errors --
error.field.notValid=Field "{0}" is not valid.
....

The output should be:

Field "Agreement Type" is not valid.

You're much better off posting your question to the Struts user list...
recent history shows that I'm the only one here answering Struts
questions, and there are dozens of people on struts-user just waiting to
help. :) http://struts.apache.org/mail.html

Ok. Next question I will send there. Tkank you for a hint and for an
interest to my problem. :)

Best regards,
Konrad Billewicz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top