title: Struts 2 Action Message - not displayed on the UI
body: <p>I want to display an info message to the user on submit of the action but the message is not getting displayed. It works if I use <code>addActionError</code> but I want to display as an info message and hence using the <code>addActionMessage</code>. Please let me know where I went wrong.  </p>
  
  <pre><code>public void validateUser() {
          List&lt;Product&gt; existingProductList = new ArrayList&lt;Product&gt;();
  
          try {
              IProductRepository productRepository = daoRepository
                  .getProductRepository();
              existingProductList = digestRepository
                  .searchDigests(null, null);
              } catch (Exception e) {
          e.printStackTrace();
                    }
          for (Product product: existingProductList ) {
              if (prod.getQuartzNumber().equalsIgnoreCase(
                  product.getQuartzNumber())) {
              addActionMessage("The Quartz number entered already exists");
              break;
          }
      }
  }
  </code></pre>
  
  <p>Below is my jsp code:</p>
  
  <pre><code>&lt;div id="content-wrapper"&gt;
      &lt;div id="product_create_header"&gt;
          &lt;h2&gt;Create a New product&lt;/h2&gt;
      &lt;/div&gt;
  
      &lt;!-- Error messages --&gt;
      &lt;dl id="dyna_product_create_errors" class="error"&gt;&lt;/dl&gt;
  
  
      &lt;form id="product_create_form" method="post"&gt;
          &lt;!-- product identifiers --&gt;
          &lt;!-- product details --&gt;
          &lt;fieldset id="product_create_details"&gt;
              &lt;legend&gt;product Details&lt;/legend&gt;
              &lt;div class="form-element"&gt;
                  &lt;label for="product_create_name"&gt;Name:&lt;/label&gt;&lt;br /&gt;
                  &lt;input id="product_create_name" type="text" name="product.name" value="" maxlength="256" /&gt;&lt;br /&gt;
                  &lt;span id="product_create_name_error" class="error"&gt;&lt;/span&gt;
              &lt;/div&gt;
  
              &lt;div class="form-element"&gt;
                  &lt;label for="product_create_presentation_order"&gt;Quartz Order:&lt;/label&gt;&lt;br /&gt;
                  &lt;input id="product_create_presentation_order" type="text" name="product.quartzOrder" value="" maxlength="256" /&gt;&lt;br /&gt;
                  &lt;span id="product_create_presentation_order_error" class="error"&gt;&lt;/span&gt;
              &lt;/div&gt;
  
          &lt;/fieldset&gt;
  
          &lt;!-- Form buttons --&gt;
          &lt;div id="product_create_buttons" class="formButtons"&gt;
              &lt;button id="product_create_button_cancel" type="button" title="Reset" onclick="resetproductCreateForm();"&gt;Reset&lt;/button&gt;
              &lt;button id="product_create_button_submit" type="button" title="Submit" onclick="createproduct();"&gt;Submit&lt;/button&gt;
          &lt;/div&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I see that they have added 
         
   for displaying the error, not sure how to display for messages</p>
  
  <p>Below is my js code:</p>
  
  <pre><code>function createproduct() {
      dojo.xhrPost( {
          url :"services/product/create",
          handleAs :"json",
          preventCache :"true",
          load : function(returnObject, ioArgs) {
              if (returnObject.status == "success") {
                  product = returnObject.body;
                  displayproductDetail();
              }
              else if (returnObject.status == "input") {
                  var errorList = dojo.byId("dyna_product_create_errors");
                  handleActionErrors(returnObject.actionErrors, errorList);
                  handleActionMessage(returnObject.actionMessages, messageList);
                  handleCreateproductsFieldErrors(returnObject.fieldErrors);
              }
              else if (returnObject.status == "error") {
                  resetproductSearchFormErrors();
  
                  var errorList = dojo.byId("dyna_product_create_errors");
                  handleActionErrors(returnObject.actionErrors, errorList);
              }
          },
          error : function(error) {
              handleHTTPError(error);
          },
          form :'product_create_form'
      });
  }
  </code></pre>