0
我想知道這個文件是否正確,因爲我不太瞭解攔截器。我的文件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的更多細節。
拼寫檢查幫助計數嗎? 「Please」有6個字母,而不是3個,並且在問題中沒有真正需要(合理完整的樣本和詳細的錯誤顯示比拼錯尋求幫助更多的努力)。即你的XML在這個問題上看起來並不合適。 –
@ Alexei Levenkov我編輯了我的文件,請再試一次,因爲驗證對我不起作用,消息錯誤不會顯示出來,表明我的問題。 – Issamovitch