Struts 1 作為早期 MVC 框架代表,其核心流程圍繞 ActionServlet 展開:
struts-config.xml 映射查找 ActionMapping。ActionForm(表單數據載體),執行驗證。Action 業務邏輯,返回 ActionForward。
上圖清晰展示了從 HTTP 請求到視圖響應的完整鏈路,配合實戰經驗易於理解。
<action-mappings>
<action path="/login"
type="com.example.LoginAction"
name="loginForm"
scope="request"
input="/login.jsp">
<forward name="success" path="/welcome.jsp"/>
<forward name="failure" path="/login.jsp"/>
</action>
</action-mappings>

圖片展示了 struts-config.xml、ActionForm、Action、JSP 頁面的對應關係。