0

Let say I have jsp pages named list_question.jsp and ajax_result.jsp

in struts.xml

<action name="question/*/*" class="ProcessAction" >
  <param name="selectedCatId">{1}</param>
  <param name="questionId">{2}</param>
  <result name="success">list_question.jsp</result>
</action>

<action name="submitReponse" class="AJXAction" >
  <result name="success">ajax_result.jsp</result>
</action>

the scenario as follows:

First, the page list_question.jsp is displayed as the success result of ProcessAction. Everything worked perfectly.

Then, inside list_question.jsp, I perform an ajax call as follows:

$("#postResponse").click(function(){
                $("#responses").html("loading...");
                $.ajax({
                        type:"POST",
                        url: "submitReponse", // Action name
                        data: $('form').serialize(),
                        success: function(data){
                            $("#responses").html(data);
                        }
                        }); 
            });

The problem is, it never called the AJXAction action class, rather it always invoked the previous action class (ProcessAction), even though different action names are specified.

I am missing something?

4

0 回答 0