私は Struts フレームワークの初心者です。アクションマッピングが正確にどのように機能するかを理解しようとしています。AJAX リクエストを送信する JavaScript ファイルがあるとします。
$("button").click(function(){
$.ajax({url: "myTestUrl.do", success: function(result){
//do something with result
});
});
私のstruts-config.xml
ファイルは次のようになります。
<?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>
action
との関係がわかりませんform-bean
。私のリクエストは によって処理されTestAction
ますか? もしそうなら、フォーム Beantype
属性の目的は何ですか?
更新:
Struts MCV フレームワークの優れた概要が必要な人は、このリンクをチェックしてください。