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

、如果是简单的单一的一个 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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值