Hi,
Can anyone explain what should be used as the id value in the html:messages
id=... .../ tag? Where to define it? I read the doc
(http://struts.apache.org/1.3.10/struts-taglib/tlddoc/html/messages.html)
but can't figure it out.
In Action class,
ActionMessages messages = new ActionMessages
hello all
i've a new-user page (say new_user.jsp) . am inserting a new
user into db. after inserting am mapping my page to new_user.jsp . what my
doubt is i've to display a message User created successfully. how do i do
it? help me out of this please.
note : am
In your action method use addActionMessage. Then in the jsp page use
s:actionmessage/ to display the message(s) in the list.
You will be using the MessageStoreInterceptor. If you are using 2.1.6 make
sure the store interceptor is in your stack in struts.xml. If you are
using an earlier
Thanks for replying me. am using struts 1.2 . how do i do it in struts 1.2
dusty wrote:
In your action method use addActionMessage. Then in the jsp page use
s:actionmessage/ to display the message(s) in the list.
You will be using the MessageStoreInterceptor. If you are using
to rule the user input.
At the client side (web page), I use the following code to show the error
information to the user.
logic:messagesPresent message=false
tr
td
html:messages id=error
bean:write
tr
td
html:messages id=error
bean:write name=error/
/html:messages
/td
/tr
/logic:messagesPresent
But the error I got related to bean:write tag
Title: Common Resource bundles across web projects, ActionMessage and html:messages
Hi all,
We are using the ActionMessage-s with replacement values.
We want to divide the resource bundles so that we have a 'common-layout-jar' which contains common messages
When you use messages from an alternate (i.e. non default) message
resources you need to specify the bundle attribute in the
html:messages tag.
So if you have something like this in your struts-config,xml:
message-resources parameter=ApplicationResources/
message-resources parameter
html:errors isn't deprecated - both html:errors and html:messages
offer different ways of doing the same thing. When it comes to displaying a
message against a single property, html:errors is easier and the issue of
including markup in resource bundles doesn't arise.
http
Using struts 1.2.7
which one to use? html:messages or html:errors??
I am using html:errors now and displaying errors for each property i.e using
html:errors property=custName/
Just wondering why html:messages is available? when this tag can be used?
Thanks
On 3/13/06, fea jabi [EMAIL PROTECTED] wrote:
Using struts 1.2.7
which one to use? html:messages or html:errors??
http://www.niallp.pwp.blueyonder.co.uk/HelpTagsErrorsAndMessages.html
--
Wendy
-
To unsubscribe, e-mail
Hi fea
html:errors/ is deprecated as it doesn't allow html styling to the
messages, the only way thats possible is through the reasource bundle which
is bad design priciple. html:messages allow messages to be formatted using
html.
here is an eg.
font color=green
Greetings,
I am unable to find a solution... even after searching... and waiting for
the espresso to kick in.
I have messages and would like to determine the number of messages in the
bean.
If there is more than one message format the output as a list or else just
display the message.
Unable
(request,msgs);
(Notice that I'm trying out the resource-free ActionMessage from 1.2.7)
Using html:messages/ as follows, I only get the first message:
html:messages id=someMessagec:out value=${someMessage}/
/html:messages
If I just use html:errors/, I get both messages. Am I missing
something
Hi,
I am having trouble getting messages to display using the html:messages
tag. I have tried to help myself and followed the struts docs but I
can't seem to get this to work. The html:errors tag works fine. Here's
what I am trying to do:
I have an action that is trying to add a global
if (!messages.isEmpty())
saveMessages(request, messages);
use addMessages(). saveMessages has been deprecated.
ul
html:messages id=message
lic:out value=${message} //li
/html:messages
/ul
You left out the message attribute. Set it to true.
ul
Hi,
Thanks for the response, but no dice, still doesn't work. I changed the
jsp to the following:
code-snippet
ul
html:messages id=message message=true
lic:out value=${message} //li
/html:messages
/ul
/code-snippet
I am using Struts 1.1 so I don't have access to addMessages
Try the following... Don't forget to import struts-bean.tld
%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
I think it is better to use struts-tags when possible since they were designed
for Struts.
ul
html:messages id=message message=true
li bean:write name=message//li
Hi,
Thanks again but still not working. I tried as you suggested. I don't
think it is a problem with the c:out tag anyway because when I look at
what the browser gets I see
ul
/ul
And not
ul
li
/li
/ul
Anyway, I will get the struts source and step through the html:messages
code
/
/logic:messagesPresent
logic:messagesPresent message=true
html:messages id=msg message=true header=message.header
footer=message.footer
lifont color=bluebean:write name=msg //font/li
/html:messages
/logic:messagesPresent
Ross Gibb wrote:
Hi,
Thanks for the response
logic:messagesPresent message=true
html:messages id=msg message=true header=message.header
footer=message.footer
lifont color=bluebean:write name=msg //font/li
/html:messages /logic:messagesPresent
Ross Gibb wrote:
Hi,
Thanks for the response, but no dice, still doesn't
/
/logic:messagesPresent
logic:messagesPresent message=true
html:messages id=msg message=true header=message.header
footer=message.footer
lifont color=bluebean:write name=msg //font/li
/html:messages /logic:messagesPresent
Ross Gibb wrote:
Hi,
Thanks
redirect=true/
/global-forwards
I want to display a message at the top using html:messages.
I seem to recall needing the redirect set to true but I can't remember
why. Is that affecting it?
Thanks,
Ross
Daniel Henrique Ferreira e Silva wrote:
Hi Ross,
I know this maybe can't make any
html:messages.
I seem to recall needing the redirect set to true but I can't remember
why. Is that affecting it?
Thanks,
Ross
Daniel Henrique Ferreira e Silva wrote:
Hi Ross,
I know this maybe can't make any sense but i got this problem once due
to some mistakes handling scopes.
Let me
is a string that contains the status of the request.
The jsp has near the top if the body tile
snip
tiles:put name=body type=string
hr align=left width=800 color=#00 noshade
logic:messagesPresent message=true
h3font color=redMessages:/font/h3
ul
html:messages id=msg
The problem is with how you've configured your messages resources. Because
you've specified a key your message resources are not being stored under the
default messages resources key. There being stored under the bundle key
ApplicationResources. You just need to remove that (and the id, its
PROTECTED]
Sent: Wednesday, April 06, 2005 11:30 AM
To: Struts Users Mailing List
Subject: Re: Html:messages vs html:errors
The problem is with how you've configured your messages resources.
Because
you've specified a key your message resources are not being stored under
the
default messages
PROTECTED]
Sent: Wednesday, April 06, 2005 2:14 PM
To: 'Struts Users Mailing List'
Subject: RE: Html:messages vs html:errors
Thanks,
But ARG That wasn't it. I changed the message-resources tag as you
suggest,
message-resources null=false parameter=ApplicationResources/
however I am still
Hooray, I found it, thanks to Allen and Niall.
logic:messagesPresent message=true
h3font color=redMessages:/font/h3
ul
html:messages id=msg message=true
libean:write name=msg //li
/html:messages
/ul
Hi,
I'm a Struts newbie. A lot of the books and documentation I have on Struts
is pre 1.2 and uses html:errors and ActionErrors. Given ActionErrors is
deprecated, I'd like to use ActionMessages for some new JSPs I'm writing.
Does anyone know of links to more up-to-date articles or
I'm a Struts newbie. A lot of the books and documentation I have on Struts
is pre 1.2 and uses html:errors and ActionErrors. Given ActionErrors is
deprecated, I'd like to use ActionMessages for some new JSPs I'm writing.
the usage is the same.
actionerrors are dependent on certain keys such
Here are wiki topics that discuss this:
http://wiki.apache.org/struts/StrutsDeprecatedActionErrors
http://wiki.apache.org/struts/ActionErrorsAndActionMessages
Hubert
On Apr 5, 2005 8:18 AM, Fergal O'Shea [EMAIL PROTECTED] wrote:
Hi,
I'm a Struts newbie. A lot of the books and
We don't seem to have struts-examples.war readily available here at work.
Does anyone have an example of overriding an ActionForm's validate() method,
but using ActionMessage instead of ActionError (I presume you still have to
use a Collection of ActionErrors), and using html:messages instead
From this and other messages I think you've got the wrong end of the stick
regarding the html:errors tag. You can use either html:errors or
html:messages with ActionMessage, its just down to personal preference.
I've added a page comparing html:errors and html:messages here:
http
This seems to be one of the biggest problems for Struts users, I am
still on 1.1 but had so much trouble with html:errors/ that I am sure
moving to html:messages will be better, I too want to do that, but not
finding what to do.
Michael Oliver
CTO
Alarius Systems LLC
3325 N. Nellis Blvd, #1
Las
I tried the example from the HelpTagsErrorsAndMessages.html in my jsp
near the top of the body.
logic:messagesPresent
h3font color=red/fontMessages:/h3
ul
html:messages id=msg
libean:write name=msg //li
/html:messages
the HelpTagsErrorsAndMessages.html in my jsp
near the top of the body.
logic:messagesPresent
h3font color=red/fontMessages:/h3
ul
html:messages id=msg
libean:write name=msg //li
/html:messages
/ul
/logic:messagesPresent
hihi,
has anyone a good way to handle displaying multiple messages that come
from multiple bundles (resource files) on the jsp?
how can i make my jsp handle messages that can come from more than one
bundle?
the reason why i need to do this is because we made a base
application that all projects
: html:messages with multiple bundles?
hihi,
has anyone a good way to handle displaying multiple messages that come
from multiple bundles (resource files) on the jsp?
how can i make my jsp handle messages that can come from more than one
bundle?
the reason why i need to do this is because we made
, September 30, 2004 2:23 PM
Subject: html:messages with multiple bundles?
hihi,
has anyone a good way to handle displaying multiple messages that come
from multiple bundles (resource files) on the jsp?
how can i make my jsp handle messages that can come from more than one
bundle
usage:
...
msg = new ActionMessage(your key in message resources file,
stop);
messages.add(message2, msg)
...
and in jsp use:
html:messages id=msg message=true
bean:write name=msg/br
/html:messages
which writes all the messages
Detailed example can be found at:
http://javaboutique.internet.com
Hi Im have been using pretty standard code to display error messages so far, eg:
logic:messagesPresent
html:messages id=error
libean:write name=error//li
/html:messages
brbr
/logic:messagesPresent
But now, the problem I am facing is that I want to display a subset of my
ActionErrors();
errors.add('company', new ActionError());
errors.add('factory', new ActionError());
now in you loop wrap you bean:wrie in an if statement:
logic:messagesPresent
html:messages id=error
c:if test=${error.key == 'company'}
libean:write name=error//li
Subject: Re: Problem with displaying a subset of error messages using
html:messages
Hello Asif,
Now I havn't checked what I'm going to write here but am pretty sure it
should work.
First of all while adding your ActionError to ActionErrors use 'company'
as
the key for the company errors
Okay, while out for lunch i thought about it and i think the right way of
doing it would be to use property attribute of the html:messages tag:
http://jakarta.apache.org/struts/userGuide/struts-html.html#messages
henc new code:
logic:messagesPresent
html:messages id=error property=company
]
Sent: Thursday, June 24, 2004 4:56 PM
Subject: Re: Problem with displaying a subset of error messages using
html:messages
Okay, while out for lunch i thought about it and i think the right way of
doing it would be to use property attribute of the html:messages tag:
http://jakarta.apache.org
is the code snipplet in my jsp
logic:messagesPresent message=true
Msg=html:messages id=msg message=true property=x /
/logic:messagesPresent
The output is always Msg=
Any idea? Thanks
-Betty
-Original Message-
From: Ram Venkataswamy [mailto:[EMAIL
, June 16, 2004 8:19 PM
Subject: Html:messages tag
Hi All,
I seem not to be able to get html:message print out the message I set up
in
the action at all.
I have looked at the request attribute, it does contain the ActionMessages
and I was able to retrieve the message for a particular property
I did, it doesn't help. Nothing get printed out at all.
-Betty
-Original Message-
From: Chris Cranford [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 5:27 PM
To: Struts Users Mailing List
Subject: Re: Html:messages tag
Have you tried removing property from the messages tag
How are you creating the message inside your action? Can you post that code
snippet?
- Original Message -
From: Betty Koon [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 8:30 PM
Subject: RE: Html:messages tag
I did, it doesn't help
I didn't know I have to do the following:
logic:messagesPresent message=true
html:messages id=msg message=true property=x /
Msg=bean:write name=msg /
/logic:messagesPresent
-Betty
-Original Message-
From: Betty Koon [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 5:31 PM
Yup :-) ... that is correct ... :-)
- Original Message -
From: Betty Koon [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 8:33 PM
Subject: RE: Html:messages tag (Resolved)
I didn't know I have to do the following
This isn't the correct way to use html:messages.
It iterates over either all the messages (if you don't specify a property)
or all messages for a property storing each message as a page scope
variable. The way your using it it will only display the last message (try
putting two messages
, 2004 7:18 PM
To: Struts Users Mailing List
Subject: Re: Html:messages tag (Resolved)
This isn't the correct way to use html:messages.
It iterates over either all the messages (if you don't specify a property)
or all messages for a property storing each message as a page scope
variable. The way
I did elaborate in a code snippets. The html:messages tag is designed to
have a body, and process it iteratively - in your example it will iterate
over all messages with a property x processing the body of the tag for
each message it finds. The reason your code works is by accident - it stores
Hi Friends!
i'm using tiles where i want to get html:errors from properties file.
But i'm not getting.
i'm adding and saving errors in action class only.And errors are not specific to any
property but those are global using GLOBAL_MESSAGE.
i'm sure that messages are available in properties
56 matches
Mail list logo