Struts2 action的扩展名两种修改方法

xiaoxiao2024-07-25  38

STRUTS2 ACTION的扩展名默认为.action,在struts1.X前为.do,如果要把STRUTS2的ACTION 的扩展名也改成.do可以按如下方法做。方法一struts.xml

< struts >       < constant  name ="struts.action.extension"  value ="do"   />  //注意这里        < package  name ="default"  extends ="struts-default"   namespace ="/example" >        < action  name ="HelloWord"  class ="example.HelloWord" >        < result  name ="SUCCESS" > /example/HelloWord.jsp </ result >             </ action >        </ package >       <!--         <include file="example.xml"/>           -->        <!--  Add packages here  -->    </ struts >   

 

方法二:

web.xml

给filter加个init-param

< init-param >    < param-name > struts.action.extension </ param-name >    < param-value > do </ param-value >    </ init-param >   

々上善若水々 2009-03-31 09:39 发表评论 相关资源:敏捷开发V1.0.pptx
转载请注明原文地址: https://www.6miu.com/read-5017108.html

最新回复(0)