我想知道这个文件是否正确,因为我不太了解拦截器。
struts.xml:
<struts>
<interceptors>
<interceptor-stack name="storeStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="store">
<param name="operationMode">STORE</param>
</interceptor-ref>
</interceptor-stack>
<interceptor-stack name="retrieveStack">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="store">
</interceptor-ref>
</interceptor-stack>
</interceptors>
<action name="index">
<result>/JSPs/eleve/view.jsp</result>
</action>
<action name="ajoutereleves" class="com.injaz.struts2.actions.NavigateAction" method="navigateToAjouterEleveJsp">
<result name="ajoutereleves">/JSPs/eleve/addeleve.jsp</result>
</action>
<action name="listereleves" class="com.injaz.struts2.actions.NavigateAction" method="navigateToListerElevesJsp">
<result name="listereleves">/JSPs/eleve/showseleves.jsp</result>
</action>
<action name="manageeleves" class="com.injaz.struts2.actions.NavigateAction" method="navigateToUpdateElevesJsp">
<result name="manageeleves">/JSPs/eleve/manageeleves.jsp</result>
</action>
<action name="ajoutereleverecord" class="com.injaz.struts2.actions.AddEleveAction" method="execute">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="store"/>
<result name="success">/JSPs/eleve/addeleve.jsp</result>
<result name="error">/JSPs/eleve/addeleve.jsp</result>
</action>
<action name="updateeleve" class="com.injaz.struts2.actions.UpdateEleveAction" method="execute">
<result type="json">
<param name="contentType">text/html</param>
</result>
</action>
<action name="getupdateeleve" class="com.injaz.struts2.actions.EditEleveAction" method="getEleveObject">
<interceptor-ref name="storeStack" />
<result name="success">/JSPs/eleve/editeleve.jsp</result>
<result name="error">/JSPs/eleve/editeleve.jsp</result>
</action>
<action name="eleveTable" method="getEleveTable"
class="com.injaz.struts2.actions.EleveJsonTable">
<result type="json">
<param name="contentType">text/html</param>
</result>
</action>
<action name="validateEleve" class="com.injaz.struts2.validator.EleveValidator" method="validateEleveNom">
<result type="json">
<param name="contentType">text/html</param>
</result>
</action>
</package>
</struts>
我正在使用 Struts 2.3.1 获取更多详细信息。