Chinaunix首页 | 论坛 | 博客
  • 博客访问: 739668
  • 博文数量: 771
  • 博客积分: 6000
  • 博客等级: 准将
  • 技术积分: 5005
  • 用 户 组: 普通用户
  • 注册时间: 2008-09-11 14:24
文章分类

全部博文(771)

文章存档

2011年(1)

2008年(770)

我的朋友

分类:

2008-09-11 14:33:50

    struts2 学习

    一。 核心文件struts.xml 的配置

      1。 bean的配置

          主要就是名字的一个引用

   

     

      ...

    The bean element has one required attribute, class, which specifies the class to be created or manipulated. A bean can either be created by the framework's container and injected into internal framework objects, or have values injected to its static methods The first use, object injection, is generally accompanied by the type attribute, which tells the container which interface this object implements. The second use, value injection, is good for allowing objects not created by the container to receive framework constants. Objects using value inject must define the the static attribute.Attribute  Required  Description  class  yes  the name of the bean class  type  no  the primary interface this class implements  name  no  the unique name of this bean; must be unique among other beans that specify the same type  scope  no  the scope of the bean; must be either default, singleton, request, session, thread  static  no  whether to inject static methods or not; shouldn't be true when the type is specified  optional  no  whether the bean is optional or not 3 Packages的配置简单就包的配置 是配置的一个逻辑规划Attribute  Required  Description  name  yes  key to for other packages to reference  extends  no  inherits package behavior of the package it extends  namespace  no  see Namespace Configuration  abstract  no  declares package to be abstract (no action configurations required in package) Sample usage Package Example (struts.xml)
     
       

                  class="org.apache.struts2.showcase.action.EmployeeAction" >
            /empmanager/listEmployees.jsp
           
       

       
          {1}
          /empmanager/editEmployee.jsp
           
              execute
           

         

                        class="org.apache.struts2.showcase.action.EmployeeAction" >
            /empmanager/editEmployee.jsp
            edit-${currentEmployee.empId}.action
         

                      class="org.apache.struts2.showcase.action.EmployeeAction" >
            /empmanager/editEmployee.jsp
            edit-${currentEmployee.empId}.action
         

     
   


 

[1]    

【责编:landy】

--------------------next---------------------

阅读(355) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~