ActionError not getting displayed

I want to load my Error.jsp in my ErrorDiv if Action class returns error. I am doing an AJAX call.


success: function(result){    
    if(result === 'success')
        alert('Database Updated Successfully!');



    request.setAttribute("decorator", "none");
    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0
    response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
<s:if test="hasActionErrors()">
       <s:actionerror />


However, action errors are not getting displayed. In firebug I checked, response to GET Error.jsp in that the <body> </body> part comes empty.

Why are actionError not getting displayed?


Action Class:

slsConfigureTspThresholdRemote.setThresholdParameters(circleId, tspId, thresholdTypeFlag, thresholdParametersList);

catch (Exception e){    

    result = "error";
    return ERROR;


<action name="updateThresholdParameters"
class="cdot.oss.cmsat.gma.struts.ConfigureTspThresholdAction" method="updateThresholdParameters">

<result name="success" type="json">
    <param name="root">result</param>

<result name="error">pages/Error.jsp</result>

Presently, I am doing $('#ErrorDiv').html(result); so that my JSP get loaded in div instead of




The validation errors are available only to the same request. Also direct access to the JSPs might be handled by the web container where the struts tags will not work. You should use an action to render a JSP and the action should run a message store interceptor if you want to keep the validation errors from the previous request. If you want to use the same response to return a different result you can set the different status code with each result. On the client you could check the status code returned by the Ajax response an do corresponding things.

success: function(data, textStatus, jqXHR){
    if(jqXHR.status == 201) {
    } else {
      alert('Database Updated Successfully!'); 

In the JSP add the following to the scriptlet code



Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.