Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ★ 1. pom.xml
- <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>ShoppingMall</groupId>
- <artifactId>ShoppingMall</artifactId>
- <version>0.0.1-SNAPSHOT</version>
- <packaging>war</packaging>
- <build>
- <sourceDirectory>src</sourceDirectory>
- <plugins>
- <plugin>
- <artifactId>maven-war-plugin</artifactId>
- <version>2.6</version>
- <configuration>
- <warSourceDirectory>WebContent</warSourceDirectory>
- <failOnMissingWebXml>false</failOnMissingWebXml>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>3.3</version>
- <configuration>
- <source>1.8</source>
- <target>1.8</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-webmvc</artifactId>
- <version>4.2.6.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>javax.servlet-api</artifactId>
- <version>3.1.0</version>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-jdbc</artifactId>
- <version>4.2.6.RELEASE</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis</artifactId>
- <version>3.4.0</version>
- </dependency>
- <dependency>
- <groupId>org.mybatis</groupId>
- <artifactId>mybatis-spring</artifactId>
- <version>1.3.0</version>
- </dependency>
- <dependency>
- <groupId>org.aspectj</groupId>
- <artifactId>aspectjweaver</artifactId>
- <version>1.8.9</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.7.4</version>
- </dependency>
- <!-- http://mvnrepository.com/artifact/commons-fileupload/commons-fileupload -->
- <dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.3.1</version>
- </dependency>
- </dependencies>
- </project>
- ★ 2. web.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/javaee"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
- id="WebApp_ID" version="3.0">
- <context-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>WEB-INF/model.xml</param-value>
- </context-param>
- <listener>
- <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
- </listener>
- <filter>
- <filter-name>encoding</filter-name>
- <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
- <init-param>
- <param-name>encoding</param-name>
- <param-value>UTF-8</param-value>
- </init-param>
- </filter>
- <filter-mapping>
- <filter-name>encoding</filter-name>
- <url-pattern>/*</url-pattern>
- </filter-mapping>
- <servlet>
- <servlet-name>dispatcher</servlet-name>
- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
- <init-param>
- <param-name>contextConfigLocation</param-name>
- <param-value>WEB-INF/front-controller.xml</param-value>
- </init-param>
- </servlet>
- <servlet-mapping>
- <servlet-name>dispatcher</servlet-name>
- <url-pattern>*.do</url-pattern>
- </servlet-mapping>
- </web-app>
- ★ 3. front-controller.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:p="http://www.springframework.org/schema/p"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:jee="http://www.springframework.org/schema/jee"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:mvc="http://www.springframework.org/schema/mvc"
- xsi:schemaLocation="http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.2.xsd
- http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd
- http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd">
- <!-- 자동으로 @Controller만 메모리에 올린다. -->
- <context:component-scan base-package="com.shoppingmall.*">
- <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
- </context:component-scan>
- <!-- viewResolver 정의!! -->
- <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"
- p:prefix="/"
- p:suffix=".jsp"/>
- <!-- 파일 업로드 설정 -->
- <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
- <!-- TranSaction 등록!!! -->
- <tx:advice id="txtAdvice" transaction-manager="dataSourceTransactionManager">
- <tx:attributes>
- <!-- 트랜잭션을 적용할 메서드를 등록 -->
- <tx:method name="insert" propagation="REQUIRED"/>
- <!-- name:적용할 메서드 이름. propagation : 트랜잭션을 무조건 처리할 것인지 여부. -->
- </tx:attributes>
- </tx:advice>
- <!-- AOP 설정!! -->
- <aop:config>
- <!-- 접근지정자:public / 반환형:모든것 / 패키지:패키지에 있는 Service가 들어가는 모든 클래스의 모든 매서드에 적용. / 매개변수 : 모든것 -->
- <aop:pointcut expression="execution(public * com.shoppingmall.*.service.*Service*.*(..))" id="serviceCut"/>
- <!-- aop적용될 코드를 입력. -->
- <aop:advisor advice-ref="txtAdvice" pointcut-ref="serviceCut"/>
- </aop:config>
- <!-- 로그인 처리용 HandlerInterceptor 등록!! -->
- <mvc:interceptors>
- <mvc:interceptor>
- <mvc:mapping path="/admin/**"/>
- <mvc:exclude-mapping path="/admin/login.*"/>
- <bean class="common.intercepter.LoginCheckInterceptor"/>
- </mvc:interceptor>
- </mvc:interceptors>
- </beans>
- ★ 4. pom.properties
- #Generated by Maven Integration for Eclipse
- #Mon Oct 14 15:18:52 KST 2019
- version=0.0.1-SNAPSHOT
- groupId=ShoppingMall
- m2e.projectName=ShoppingMall
- m2e.projectLocation=C\:\\Users\\hj\\Desktop\\ShoppingMall-master\\ShoppingMall-master\\ShoppingMall
- artifactId=ShoppingMall
- ★ 5. model.xml
- <?xml version="1.0" encoding="UTF-8"?>
- <beans xmlns="http://www.springframework.org/schema/beans"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:aop="http://www.springframework.org/schema/aop"
- xmlns:context="http://www.springframework.org/schema/context"
- xmlns:jee="http://www.springframework.org/schema/jee"
- xmlns:p="http://www.springframework.org/schema/p"
- xsi:schemaLocation="http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.2.xsd
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.2.xsd">
- <!-- @Controller 제외한 모든 어노테이션 객체 메모리에 올린다. -->
- <context:component-scan base-package="com.shoppingmall.*">
- <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
- </context:component-scan>
- <!-- DataSource 등록 -->
- <jee:jndi-lookup jndi-name="jdbc/oracle" id="dataSource" resource-ref="true" />
- <!-- TransactionManger 등록 -->
- <bean id="dataSourceTransactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"
- p:dataSource-ref="dataSource"/>
- <!-- MyBatis 등록 -->
- <!-- sqlSessionFactoryBean 등록 -->
- <bean id="sqlSessionFactoryBean" class="org.mybatis.spring.SqlSessionFactoryBean"
- p:dataSource-ref="dataSource"
- p:configLocation="classpath:mybatis/config.xml"/>
- <!-- sqlSessionTemplate 등록 -->
- <bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
- <constructor-arg name="sqlSessionFactory" ref="sqlSessionFactoryBean"/>
- </bean>
- </beans>
- ★ 6. config.xml
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE configuration
- PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-config.dtd">
- <configuration>
- <typeAliases>
- <typeAlias type="com.shoppingmall.admin.model.Admin" alias="Admin" />
- <typeAlias type="com.shoppingmall.product.model.Brand" alias="Brand" />
- <typeAlias type="com.shoppingmall.product.model.Nation" alias="Nation" />
- <typeAlias type="com.shoppingmall.product.model.PanelSize" alias="PanelSize" />
- <typeAlias type="com.shoppingmall.product.model.Product" alias="Product" />
- <typeAlias type="com.shoppingmall.product.model.SubCategory" alias="SubCategory" />
- <typeAlias type="com.shoppingmall.product.model.TopCategory" alias="TopCategory" />
- <typeAlias type="com.shoppingmall.product.model.ProductBrand" alias="ProductBrand" />
- <typeAlias type="com.shoppingmall.product.model.ProductNation" alias="ProductNation" />
- <typeAlias type="com.shoppingmall.product.model.ProductSize" alias="ProductSize" />
- <typeAlias type="com.shoppingmall.product.model.ProductSub" alias="ProductSub" />
- <typeAlias type="com.shoppingmall.product.model.EventInfo" alias="EventInfo" />
- <typeAlias type="com.shoppingmall.product.model.EventProduct" alias="EventProduct" />
- <typeAlias type="com.shoppingmall.member.model.Member" alias="Member" />
- <typeAlias type="com.shoppingmall.admin.model.Notice" alias="Notice" />
- </typeAliases>
- <mappers>
- <mapper resource="mybatis/AdminMapper.xml" />
- <mapper resource="mybatis/BrandMapper.xml" />
- <mapper resource="mybatis/NationMapper.xml" />
- <mapper resource="mybatis/PanelSizeMapper.xml" />
- <mapper resource="mybatis/ProductMapper.xml"/>
- <mapper resource="mybatis/SubCategoryMapper.xml" />
- <mapper resource="mybatis/TopCategoryMapper.xml" />
- <mapper resource="mybatis/ProductBrandMapper.xml" />
- <mapper resource="mybatis/ProductNationMapper.xml" />
- <mapper resource="mybatis/ProductSizeMapper.xml" />
- <mapper resource="mybatis/ProductSubMapper.xml" />
- <mapper resource="mybatis/EventInfoMapper.xml" />
- <mapper resource="mybatis/EventProductMapper.xml" />
- <mapper resource="mybatis/MemberMapper.xml" />
- <mapper resource="mybatis/NoticeMapper.xml" />
- </mappers>
- </configuration>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement