title: Struts2 json ajax and also custom return type
body: <p>I am trying to do a result type of "json" from my struts2 action. Here is the configuration I have in my code.</p>
  
  <p>Struts.xml:</p>
  
  <pre><code>&lt;package name="example" namespace="/" extends="json-default"&gt;
      &lt;action name="vendorList" class="com.stg.providerportal.actions.AjaxVendorListAction"&gt;
        &lt;result  name="success" type="json"&gt;&lt;/result&gt;
      &lt;/action&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p>Struts Action:</p>
  
  <pre><code>private Object jsonModel;
  
  
   public String execute() throws Exception {
  
    String nextStep = SUCCESS;
  
    Map session = getSession();
    SessionParams params = (SessionParams) session.get(Constants.KEY_SESSION_PARAMS);
  
    try {
     Map json = new HashMap&lt;String,String&gt;();
     json.put("apple", "Hi");
     //vendorList = populateVendors(params,taxID,billingZipCode);
     setJsonModel(json);
     //session.put(Constants.KEY_SESSION_VENDOR_LIST, vendorList);
  
    } catch (Exception e) {
     CILogUtil.logInfo(e, params);
     nextStep = AppConstants.SYSTEM_UNAVAILABLE;
    }
  
    return SUCCESS;
   }
  </code></pre>
  
  <p>I am calling this action using ajax(jquery) and here how i make a call.</p>
  
  <pre><code>$.getJSON('vendorList.action' ,  
   {
    "taxID": taxID,
    "billingZipCode": billingZipCode      
   },
   function(json) {
   alert('hi');
   });
  
  $.ajaxSetup({"error":function(XMLHttpRequest,textStatus, errorThrown) {   
      alert(textStatus);
      alert(errorThrown);
      alert(XMLHttpRequest.responseText);
  }});
  </code></pre>
  
  <p>When i execute this I am getting back the response from the action as below. Dont know why.</p>
  
  <pre><code>Error 404: SRVE0190E: File not found: /vendorList.action 
  </code></pre>
  
  <p>Even when I am trying to run this action directly from the browser, I get the same response.</p>
  
  <pre><code>http://localhost:9081/providerportal1/vendorList.action?taxID=111billingZipCode=1111
  </code></pre>