关于Struts1.2配置文件的Action访问路径相关问题

来源:互联网 发布:网络网络语言6个字 编辑:程序博客网 时间:2024/05/14 17:05

、如果是简单的单一的一个 struts—config.xml 文件 (或者项目中所有的struts配置文件直接都在WEB-INF目录下)

对应的Action的访问路径path设置就是对应页面中访问该Action的路径

 

如:

<action attribute="BrdBaseForm"
    name="BrdBaseForm"
    parameter="method"
    path="/BrdMgrAction"
    scope="request"
    type="com.netcast.zb.prg.struts.action.brd_mgr.BrdMgrAction" >
       <forward name="fail" path="/display_message.vm" /> 
  </action>

 

在页面访问时 或 在数据库配置权限时

 页面中

   action="<c:url value='BrdMgrAction.do'/>

数据库中

    BrdMgrAction.do?method=toBackProg

 

 

2、如果项目包含多个struts配置文件,且都在WEB-INF目录下的子目录下时

对应的Action的访问路径path设置加上所在WEB-INF下文件夹名才是页面中访问该Action的路径

 

1

 

 <action attribute="basItemForm" name="basItemForm"
          parameter="method" path="/BasItem" scope="request"
       type="org.springframework.web.struts.DelegatingActionProxy">
   <forward name="itemlist" path="/itemlist.jsp" />
   <forward name="itemadd"  path="/itemadd.jsp" />
   <forward name="itemmodify" path="/itemmodify.jsp" />
   <forward name="faile" path="/../error.jsp" />
  </action>

 

在页面访问时 或 在数据库配置权限时

 页面中

   action="/BasItem.do?method=findItemList"

数据库中

    /basedata/BasSchRecord.do?method=findItemList

原创粉丝点击