Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 548667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:06:13+00:00 2026-05-13T11:06:13+00:00

I have seen that I can add errors and render them via <form:errors />

  • 0

I have seen that I can add errors and render them via <form:errors /> tag and addError() method of BindingResult class, but I wonder if there is something similar to send information messages to the JSP.

I mean, I want to add messages when the operation has been successful. I know I could do it by sending an error, but it would make no sense to me to add errors when there haven’t been any error at all.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:06:13+00:00Added an answer on May 13, 2026 at 11:06 am

    Interesting. I found this in an old project of mine.:

    (this was a base controller, but could well be an utility method)

    protected void addMessage(String key, boolean isError,
            HttpServletRequest request, Object... args) {
        List<Message> msgs = (List<Message>) request.getAttribute(MESSAGES_KEY);
        if (msgs == null) {
            msgs = new LinkedList<Message>();
        }
    
        Message msg = new Message();
        msg.setMessage(msg(key, args));
        msg.setError(isError);
        msgs.add(msg);
        request.setAttribute(MESSAGES_KEY, msgs);
    }
    

    and then in a messages.jsp which was included in all pages I had:

    <c:forEach items="${messages}" var="message">
       //display messages here
    </c:forEach>
    

    MESSAGES_KEY is a constant of mine with a value “messages” (so that it is later accessible in the forEach loop).

    The Message class is a simple POJO with those two properties. I used it for info messages as well as for custom non-validation errors.

    This is a rather custom solution, but perhaps I hadn’t found a built-in solution then. Google a bit more before using such a solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you've used Google Wave or iGoogle you have probably seen that you can
I have seen lately a couple of programs that can be launched as daemons
I have created a jQuery animation that can be seen by clicking the Preview
I have created a drop down with jQuery that can be seen here by
Can someone recommend a hosted solution that answers the following requirements (I have seen
You've probably seen web apps that have an email dropbox. Users can send email
I have seen that BindableAttribute is used to decorate public properties in custom controls.
I have seen that Windows system use temporary files to increase the performance of
I have seen that a prime number implementation of the GetHashCode function is being
I have seen that typing about:somekeywords in browsers address bar gives some information. What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.