Issue Details (XML | Word | Printable)

Key: SPR-2657
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Daigo Kobayashi
Votes: 5
Watchers: 4
Operations

If you were logged in you would be able to see more operations.
Spring Framework

There is no way to display success message(s).

Created: 29/Sep/06 08:01 AM   Updated: 12/Mar/07 10:34 PM
Component/s: SpringWEB
Affects Version/s: None
Fix Version/s: None

Time Tracking:
Not Specified


 Description  « Hide

There is no way to display success message(s) like struts' ActionMessage. Spring should provide Messages inteface in a similar way of Errors and related tag libraries.



Rick Evans added a comment - 29/Sep/06 08:12 AM

Hi Daigo

I'm not quite sure what you mean with this issue; can you please explain a little more, perhaps supplying a use case?

If you want to display data upon sucess, you can put the data that you want displayed in the ModelAndView.

Cheers
Rick


Daigo Kobayashi added a comment - 29/Sep/06 09:09 AM

Hi Rick

Actually I can set message to ModelAndView. However, I can't handle following issue cleverly.

1. I can't use LocaleResolver like Errors.
2. I want to use same way as spring:hasBindErrors to handle message, so I need spring:hasBindMessages.

Sample code:

<spring:hasBindMessages name="command">
<c:forEach var="msg" items="${errors.globalMessages}">
<span class="message"><c:out value="${msg}"/></span>
</c:forEach>
</spring:hasBindMessages>


Akram BEN AISSI added a comment - 18/Dec/06 03:16 AM

I would be also interrested with this evolution for a secondary purpose:
I want to display warning messages on validation:

In fact, I want to warn (or inform) users about some validation problems (that are not critical, not errors in facts). if the user submit the form again with no changes, I want to perform the submit.


Gunnar Hillert added a comment - 12/Mar/07 10:34 PM

Hi,

This is one area where Struts is superior IMO and I wish Spring MVC would offer functionality similar to Struts' ActionMessage. (In my opinion good success messages are just as important as good error messages
Besides providing a common infrastructure for handling error AND success messages in a standard way, it would also be great if those messages would survive redirects. Right now I am using the approach that is implemented in Matt Raible's Equinox. (Using a custom filter --> org.appfuse.web.MessageFilter).

Also, on a side note - would it be wise to have messages support for spring core? In quite a few cases my service layer methods need to pass back messages and I wonder if that is something to 'standardize' instead of rolling your own approach?

See also: http://forum.springframework.org/archive/index.php/t-29411.html

Thanks!

Regards -

Gunnar