Struts struts-config.xml action-mapping erklärt

Ich bin ein noob, Struts framework. Ich versuche zu verstehen, wie die action-mapping funktioniert genau. Angenommen ich habe eine JavaScript-Datei, die sendet eine AJAX-Anfrage:

$("button").click(function(){
    $.ajax({url: "myTestUrl.do", success: function(result){
        //do something with result
    });
});

und meine struts-config.xml - Datei sieht wie folgt aus:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.1//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
    <form-beans>
        <form-bean name="testForm" type="com.test.TestForm"/>       
    </form-beans>

    <!-- Global Forwards -->    
    <global-forwards>
    </global-forwards>

    <!-- Action Mappings -->
    <action-mappings>

        <action path="/myTestUrl" 
                type="com.test.TestAction" 
                name="testForm" 
                scope="request" />

    </action-mappings>
    <controller locale="true"/>
</struts-config>

Ich nicht verstehen, die Beziehung zwischen den action und die form-bean. Wird meine Anfrage bearbeitet werden TestAction? Wenn ja, was ist der Zweck der form-bean type Attribut?

UPDATE:

Für alle, die einen tollen überblick über struts-MCV-framework überprüfen Sie heraus diesen link: http://www.javaranch.com/journal/2002/03/newslettermar2002.jsp#struts

Es ist S1 -> struts-config_1_1.dtd.
danke. Ich habe aktualisiert die Frage.

InformationsquelleAutor Tom O. | 2016-04-06

Schreibe einen Kommentar