Struts struts-config.xml action-mapping explained

前端 未结 1 1454
青春惊慌失措
青春惊慌失措 2021-02-10 00:23

I am a noob to Struts framework. I am trying to understand how action-mapping works exactly. Suppose I have a JavaScript file that sends an AJAX request:



        
1条回答
  •  醉梦人生
    2021-02-10 01:01

    The relationship is made by the name attribute in the action config. So if you use name="testForm" then form bean with the name testForm will be injected to the action's execute method.

    Your request might be handled if the relative url match the path value in action config and you have mapped the action servlet to *.do in servlet mapping pattern.

    The type attribute of the is used to enter FQCN of the bean class that would probably extend the ActionForm. It's needed by Struts to be able to instantiate a bean when required.

    0 讨论(0)
提交回复
热议问题