title: Error: Could not find action or result No result defined for action action.Part and result {"col1":"col1","col2":"col2"}
body: <p>I'm not getting response as JSON type data from server. </p>
  
  <p>I'm using JSON plugin.</p>
  
  <pre><code>jQuery( "#dialog-form" ).dialog({ 
      autoOpen: false,
      height: 500,
      width: 750,
      modal: true,
      buttons :{
          "Search" : function(){
              jQuery.ajax({type : 'POST',
              dataType : 'json',
               url : '&lt;s:url action="part" method="finder" /&gt;',
           success : handledata})
          }
      }
  });
  var handledata = function(data)
  {
      alert(data);
  }
  </code></pre>
  
  <p>If <code>dataType = 'json'</code> I am not getting any response, but if I don't mention any <code>dataType</code>, I'm getting the HTML format of the page.</p>
  
  <pre><code>public String list(){
      JSONObject jo = new JSONObject();
      try {
          Iterator it = findList.iterator();
          while(it.hasNext()){
               SearchResult part = (SearchResult) it.next();
               jo.put("col1",part.getcol1());
               jo.put("col2",part.getcol2());
          }
          log.debug("---------&gt;:"+jo.toString());
      } catch (Exception e) {
          log.error(e);
      }
      return jo.toString();
  }
  </code></pre>
  
  <p><strong>struts.xml:</strong></p>
  
  <pre><code>&lt;package name="default" namespace="/ajax" extends="json-default"&gt;
    &lt;action name="finder" 
         class="action.Part" method="finder" name="finder"&gt;
         &lt;result type="json" /&gt;
    &lt;/action&gt;
  &lt;/package&gt;
  </code></pre>
  
  <p><strong>JSP page:</strong></p>
  
  <pre><code>&lt;div id="dialog-form" &gt;
      &lt;form action="" id="channelfinder"&gt;
          &lt;textarea id="products" name="prodnbr"&lt;s:property value='prodNbr'/&gt;   
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Console error:</strong></p>
  
  <blockquote>
    <p>org.apache.struts2.dispatcher.Dispatcher - Could not find action or result
         No result defined for action action.Part 
         and result {"col1":"col1","col2":"col2"}</p>
  </blockquote>
  
  <p><strong><code>web.xml</code>:</strong></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
       &lt;web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"&gt;
        &lt;display-name&gt;/parts&lt;/display-name&gt;
        &lt;description&gt;Parts List Web App&lt;/description&gt;
  
      &lt;filter&gt;
            &lt;filter-name&gt;struts-cleanup&lt;/filter-name&gt;
            &lt;filter-class&gt;org.apache.struts2.dispatcher.ActionContextCleanUp&lt;/filter-class&gt;
          &lt;/filter&gt;
  
          &lt;filter&gt;
          &lt;filter-name&gt;sitemesh&lt;/filter-name&gt;
          &lt;filter-class&gt;com.opensymphony.module.sitemesh.filter.PageFilter&lt;/filter-class&gt;
          &lt;/filter&gt;
  
         &lt;filter&gt;
          &lt;filter-name&gt;struts2&lt;/filter-name&gt;
          &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;actionPackages&lt;/param-name&gt;
              &lt;param-value&gt;com.action&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;struts-cleanup&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;sitemesh&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
          &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
          &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
          &lt;dispatcher&gt;INCLUDE&lt;/dispatcher&gt;
      &lt;/filter-mapping&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;struts2&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
      &lt;error-page&gt;
          &lt;exception-type&gt;java.lang.Throwable&lt;/exception-type&gt;
          &lt;location&gt;/errorPage.jsp&lt;/location&gt;
      &lt;/error-page&gt;
      &lt;error-page&gt;
          &lt;error-code&gt;404&lt;/error-code&gt;
          &lt;location&gt;/errorPage.jsp&lt;/location&gt;
      &lt;/error-page&gt;
  
    &lt;!-- Spring --&gt;
    &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
    &lt;/context-param&gt;
    &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
    &lt;/listener&gt;
  
    &lt;/web-app&gt;
  </code></pre>
  
  <p>I'm not getting data to jQuery success.
  Please correct me, whats wrong here?</p>