java开发中常用的xml,properties配置

web.xml




	
	
		org.springframework.web.context.ContextLoaderListener
	

	
	
		contextConfigLocation
		/WEB-INF/applicationContext.xml,classpath:applicationContext-*.xml
	

	
	  
		dispatcher  
		org.springframework.web.servlet.DispatcherServlet  
		
		  
        contextConfigLocation  
        classpath:web/applicationContext-dispatcherServlet.xml  
     
		1  
	  
           
	  
		dispatcher  
		/**  
	 
	
	
		index.jsp
	

  
	
		openSession
		org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
		
		
			sessionFactoryBeanName
			mySessionFactory
		
		
	
	
	
		openSession
		/*
	
	
	
	
		struts2
		org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
	
	
		struts2
		/*
	



==============================

hibernate.cfg.xml






    

        
        com.mysql.jdbc.Driver
        jdbc:mysql://localhost:3306/jd1107db
        root
        1234

        
        1

        
        org.hibernate.dialect.MySQLDialect

        
        thread

        
        org.hibernate.cache.EhCacheProvider

        
        true
        true

        

        

    



 ===============================================================

applicationContext.xml

 





				
	
	




	

	
	
		
			classpath:jdbc.properties
		
	
	
	
	
		
		
		
		
	


	
	
		
		
		
		
			
				com.cx.regist.entity
			
		
		
		
		
			
				org.hibernate.dialect.MySQLDialect
				true
				true
			
		
	

	
	


	

	
		
	

	
		
		
	

	
		
			
		
	


	
		
	

 

================================

struts.xml




	
		
			/user/success.jsp
			/user/fail.jsp
			/user/userList.jsp
			/user/loadUser.jsp
		
	
	

==================================================
jdbc.properties

#数据库的配置
jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/jd1107db
jdbc.username=root
jdbc.password=1234

===========================
log4j.properties

### direct log messages to stdout ###

log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd hh:mm:ss} %5p %c{1}:%L - %m%n


log4j.rootLogger=warn, console

log4j.logger.com.tarena.tts=debug

log4j.logger.org.hibernate=error



 

你可能感兴趣的:(java开发中常用的xml,properties配置)