SSM做一个简单的网上商城-搭建项目

项目目录:




mybatis-config.xml配置:










applicationContext.xml配置:


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans  
                        http://www.springframework.org/schema/beans/spring-beans-3.0.xsd  
                        http://www.springframework.org/schema/context  
                        http://www.springframework.org/schema/context/spring-context-3.0.xsd  
                        http://www.springframework.org/schema/mvc  
                        http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
                        http://www.springframework.org/schema/tx 
          http://www.springframework.org/schema/tx/spring-tx-3.0.xsd 
          http://www.springframework.org/schema/aop 
          http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">



         
         
         
         




         

         
         




























dispatcher-servlet.xml配置:


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd
    http://www.springframework.org/schema/mvc  
    http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">





class="org.springframework.web.servlet.view.InternalResourceViewResolver">





 






cache-period="31556926" />
cache-period="31556926" />
cache-period="31556926" />
cache-period="31556926" />
cache-period="31556926" />
cache-period="31556926" />

db.properties配置:

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://127.0.0.1:3306/jc?characterEncoding=utf-8
jdbc.username=root
jdbc.password=123456


log4j.properties配置:

log4j.rootLogger=DEBUG, stdout
log4j.appender.CONSOLE.Encoding=UTF-8
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d[%t]%-5p[%c]-%m%n
log4j.appender.syslog.encoding=UTF-8


web.xml配置:


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">


 

org.springframework.web.context.ContextLoaderListener



contextConfigLocation
classpath*:spring/applicationContext.xml


dispatch
org.springframework.web.servlet.DispatcherServlet


contextConfigLocation
classpath:spring/dispatcher-servlet.xml




dispatch

/



CharacterEncodingFilter
org.springframework.web.filter.CharacterEncodingFilter

encoding
utf-8



CharacterEncodingFilter
/*


index.jsp


总体上就这样。

你可能感兴趣的:(SSM做一个简单的网上商城-搭建项目)