上图是struts2的基本流程图
----------------------------------------------------------------------------------------------------------------------------------
loginAction对象
-----------------------------------------------------------------------------------------------------------------------
struts2配置
<struts>
<!-- Struts2的Action都必须配置在package里面 -->
<package name="default" extends="struts-default"><!--继承自默认包 -->
<!-- 定义一个login的Action类,实现类为LoginAction -->
<action name="login" class="com.struts2.action.LoginAction">
<!-- 定义结果与视图资源的映射关系 -->
<result name="success">/index.jsp</result>
<result name="fail">/fail.jsp</result>
</action>
</package>
</struts>
---------------------------------------------------------------------------------------------------------------------