Please tell me how the prepare intercetor works I am using it now & found strage behaviour
prepare()
validate()
execute()
这些都是方法
所以当我按下请求时 它调用3次
prepare()
validate()
execute()
prepare()
validate()
execute()
prepare()
validate()
execute()
I dont know whats the problem with it According to my understanding it should only run prepare method & show prepopulated data form & when user clicks on submit then it should submit the data.
请解释解释
<action name="updatebusinessinfo" class="com.controller.UpdateBusinessDetails">
<interceptor-ref name="params"/>
<!--
<interceptor-ref name="prepare"/>
<interceptor-ref name="basicStack"/>
-->
<interceptor-ref name="fileUpload">
<param name="maximumSize">2097152</param>
<param name="allowedTypes">image/png,image/gif,image/jpeg,image/pjpeg</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<result name="success">businessinfo.jsp</result>
<result name="input">businessinfo.jsp</result>
<result name="error">businessinfo.jsp</result>
</action>
Yes friends i have made mistake in struts.xml file.
Now please tell me how should i receive url parameter in prepare()
method?
http://www.myweb.com/updatebusinessinfo/23
我努力跟踪但没有工作
<action name="updatebusinessinfo/*" class="com.controller.UpdateBusinessDetails">
<param name="id">{1}</param>
<interceptor-ref name="params"/>
<!--
<interceptor-ref name="prepare"/>
<interceptor-ref name="basicStack"/>
-->
<interceptor-ref name="fileUpload">
<param name="maximumSize">2097152</param>
<param name="allowedTypes">image/png,image/gif,image/jpeg,image/pjpeg</param>
</interceptor-ref>
<interceptor-ref name="defaultStack"></interceptor-ref>
<result name="success">businessinfo.jsp</result>
<result name="input">businessinfo.jsp</result>
<result name="error">businessinfo.jsp</result>
</action>