struts1.x 配置文件详解


"-//Apache Software Foundation//DTD Struts Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config.dtd">





  
  
   
   
   
   
   
   
   
   
   
  



  
  
   
   
   
  



  
       key=""hello.error
    path="/error.jsp"
    scope="session"
    type="hello.HandleError"/>



  
  
  



  
       type="addressbook.actions.SearchAction"
    name="searchForm"
    scope="request"
    validate="true"
    input="/search.jsp">
   
  
 


   contentType="text/html;charset=UTF-8"
   locale="true"
   processorClass="CustomRequestProcessor">


   null="false"
   parameter="defaultResource"/>
   key="images"
   null="false"
   parameter="ImageResources"/>


   className="org.apache.struts.validator.ValidatorPlugIn">
  
       property="pathnames"
    value="/WEB-INF/validator-rules.xml,/WEB-INF/vlaidation.xml"/>


一、为struts配置web.xml 
1,配置ActionServlet(only one),使其接收应用程序收到的所有请求 
分为两步,a:使用servlet元素配置servlet实例,做servlet-mapping 
 
 
storefront 
完全限定的类名 
 
 
storefront 
*.do 
 
 
2,配置初始化参数:init-param,以name/value表示 
config :默认为/WEB-INF/struts-config.xml 
config/sub1:config/... 从附加的struts配置文件中加在资程序sub1 
debug:servlet的调试detail 
detail:Digester的调试detail 
convertHack 
3,使用struts提供的标记库时必须配置包括 
识别web应用程序所使用的标记库,必须是有效的 
指定了标记库描述文件的位置 
4,配置在web app中输入有效的,但不完整的url所使用的default resource;不使用servlet映射 
起始和结束都没有/符号 
5, 
(
< 

二、Struts配置文件 
ApplicationConfig: 包含了struts配置文件中的所有信息 
1,  
 
 
2, 
 
 
 
 
3, 
4,

在Struts1.3中已经取消了标签,也就是说只能在1.2版中配置,因为Apache不推荐在struts-config.xml中配置数据源。所以建议不要在struts中配置数据源,如果你用了hibernate或spring得话就可以在hibernate配置文件或spring文件配数据源如果都没用就到tomcat中配置  

你可能感兴趣的:(poi,struts1.x)