假设添加文章的action为addArticle.do,添加完文章之后,跳转到articleList.do,如果"redirect"没有设为"true"(默认"false"),则刷新页面后又添加文章了。
<action-mappings>
<action path="/articleList" type="org.springframework.web.struts.DelegatingActionProxy" scope="request">
<forward name="succeed" path="/codeTypeList.jsp" />
</action>
<action-mappings>
<action path="/articleList" type="org.springframework.web.struts.DelegatingActionProxy" scope="request">
<forward name="succeed" path="/codeTypeList.jsp" />
</action> <action path="/addArticle" type="org.springframework.web.struts.DelegatingActionProxy" scope="request">
<forward name="succeed" path="/articleLi" redirect="true"/>
</action>
</action-mappings>
<forward name="succeed" path="/articleLi" redirect="true"/>
</action>
</action-mappings>
本文介绍了一个使用Struts框架实现的文章添加功能,并详细解释了如何通过配置实现添加文章后的页面重定向,避免重复提交的问题。
703

被折叠的 条评论
为什么被折叠?



