牛仔裤的夏天

JAVA是蓝色的- online

  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  30 随笔 :: 5 文章 :: 15 评论 :: 0 Trackbacks

1.为每个模块准备一个配置文件,如:
  struts-config.xml(缺省配置文件),
  struts-config-customer.xml,
  struts-config-order.xml
每个配置文件的写法可以参照struts-config.xml

2.配置web.xml文件

< servlet >
< init - param >      // 缺省模块
     < param - name > config </ param - name >
    
< param - value >/ WEB - INF / struts - config.xml </ param - value >
</ init - param >

< init - param >       // customer模块
     < param - name > config / customer </ param - name >
    
< param - value >/ WEB - INF / struts - config - customer.xml </ param - value >
</ init - param >

< init - param >       // order模块
     < param - name > config / order </ param - name >
    
< param - value >/ WEB - INF / struts - config - order.xml </ param - value >
</ init - param >
</ servlet >

3.准备各个模块所需的ActionForm、Action和JSP等资源

在多模块间进行全局转发
struts-config.xml:

< struts - config >
    
< global - forwards >
    
< forword name = “toModuleB”
        contextRelative
= true

        path
= / moduleB / index. do

        redirect
= true ”  />

    
</ global - forwards >
</ struts - config >
posted on 2006-03-22 16:04 luckyrobbie 阅读(363) 评论(0)  编辑  收藏 所属分类: Struts & Hibernate

只有注册用户登录后才能发表评论。


网站导航: