first 업로드
This commit is contained in:
+59
@@ -0,0 +1,59 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v9.0"/>
|
||||||
|
<classpathentry kind="src" path="target/generated-sources/annotations">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="ignore_optional_problems" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="m2e-apt" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="ignore_optional_problems" value="true"/>
|
||||||
|
<attribute name="m2e-apt" value="true"/>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
|
</classpath>
|
||||||
@@ -24,3 +24,6 @@
|
|||||||
hs_err_pid*
|
hs_err_pid*
|
||||||
replay_pid*
|
replay_pid*
|
||||||
|
|
||||||
|
.externalToolBuilders/
|
||||||
|
.settings/
|
||||||
|
target/
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>first</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.springframework.ide.eclipse.core.springbuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
|
||||||
|
<triggers>full,incremental,</triggers>
|
||||||
|
<arguments>
|
||||||
|
<dictionary>
|
||||||
|
<key>LaunchConfigHandle</key>
|
||||||
|
<value><project>/.externalToolBuilders/org.eclipse.wst.jsdt.core.javascriptValidator.launch</value>
|
||||||
|
</dictionary>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.zeroturnaround.eclipse.rebelXmlBuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.springframework.ide.eclipse.core.springnature</nature>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
|
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||||
|
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||||
|
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||||
|
<nature>org.zeroturnaround.eclipse.jrebelNature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beansProjectDescription>
|
||||||
|
<version>1</version>
|
||||||
|
<pluginVersion><![CDATA[3.6.4.201503051146-RELEASE]]></pluginVersion>
|
||||||
|
<configSuffixes>
|
||||||
|
<configSuffix><![CDATA[xml]]></configSuffix>
|
||||||
|
</configSuffixes>
|
||||||
|
<enableImports><![CDATA[true]]></enableImports>
|
||||||
|
<configs>
|
||||||
|
</configs>
|
||||||
|
<autoconfigs>
|
||||||
|
</autoconfigs>
|
||||||
|
<configSets>
|
||||||
|
</configSets>
|
||||||
|
</beansProjectDescription>
|
||||||
@@ -0,0 +1,607 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>com.company</groupId>
|
||||||
|
<artifactId>first</artifactId>
|
||||||
|
<name>first</name>
|
||||||
|
<packaging>war</packaging>
|
||||||
|
<version>1.0.0-BUILD-SNAPSHOT</version>
|
||||||
|
<properties>
|
||||||
|
<java-version>1.8</java-version>
|
||||||
|
<org.springframework-version>3.2.18.RELEASE</org.springframework-version>
|
||||||
|
<org.aspectj-version>1.7.3</org.aspectj-version>
|
||||||
|
<org.slf4j-version>1.6.6</org.slf4j-version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>mvn2</id>
|
||||||
|
<url>http://repo1.maven.org/maven2/</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
|
||||||
|
<repository>
|
||||||
|
<id>egovframe</id>
|
||||||
|
<url>https://maven.egovframe.go.kr/maven</url>
|
||||||
|
<releases>
|
||||||
|
<enabled>true</enabled>
|
||||||
|
</releases>
|
||||||
|
<snapshots>
|
||||||
|
<enabled>false</enabled>
|
||||||
|
</snapshots>
|
||||||
|
</repository>
|
||||||
|
|
||||||
|
<!-- <repository>
|
||||||
|
<id>oracle</id>
|
||||||
|
<name>ORACLE JDBC Repository</name>
|
||||||
|
<url>http://mesir.googlecode.com/svn/trunk/mavenrepo</url>
|
||||||
|
</repository>
|
||||||
|
-->
|
||||||
|
<!-- 2016.01.08 -->
|
||||||
|
<repository>
|
||||||
|
<id>codelds</id>
|
||||||
|
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
|
||||||
|
</repository>
|
||||||
|
|
||||||
|
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- Tobesoft Repo -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nexacro</groupId>
|
||||||
|
<artifactId>nexacro17-xapi</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nexacro</groupId>
|
||||||
|
<artifactId>nexacro-xapi</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.tobesoft</groupId>
|
||||||
|
<artifactId>xplatform-xapi</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- Spring -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<!-- Exclude Commons Logging in favor of SLF4j -->
|
||||||
|
<exclusion>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-web</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-webmvc</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-aop</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-beans</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context-support</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-core</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-jdbc</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-tx</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- AOP Alliance -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>aopalliance</groupId>
|
||||||
|
<artifactId>aopalliance</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MyBatis -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis</artifactId>
|
||||||
|
<version>3.2.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis</groupId>
|
||||||
|
<artifactId>mybatis-spring</artifactId>
|
||||||
|
<version>1.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- DBCP -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tomcat</groupId>
|
||||||
|
<artifactId>tomcat-dbcp</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
<version>7.0.53</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-dbcp</groupId>
|
||||||
|
<artifactId>commons-dbcp</artifactId>
|
||||||
|
<version>1.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MySql -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>5.1.31</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc8 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
|
<artifactId>ojdbc8</artifactId>
|
||||||
|
<version>23.7.0.25.01</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc11 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
|
<artifactId>ojdbc11</artifactId>
|
||||||
|
<version>23.7.0.25.01</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.oracle.database.jdbc/ojdbc6 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle.database.jdbc</groupId>
|
||||||
|
<artifactId>ojdbc6</artifactId>
|
||||||
|
<version>11.2.0.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Oracle
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle</groupId>
|
||||||
|
<artifactId>ojdbc14</artifactId>
|
||||||
|
<version>10.2.0.4.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
2016.01.08
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.oracle</groupId>
|
||||||
|
<artifactId>ojdbc6</artifactId>
|
||||||
|
<version>11.2.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
-->
|
||||||
|
<!-- AspectJ -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.aspectj</groupId>
|
||||||
|
<artifactId>aspectjrt</artifactId>
|
||||||
|
<version>${org.aspectj-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.aspectj</groupId>
|
||||||
|
<artifactId>aspectjweaver</artifactId>
|
||||||
|
<version>${org.aspectj-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.aspectj</groupId>
|
||||||
|
<artifactId>aspectjtools</artifactId>
|
||||||
|
<version>${org.aspectj-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Web -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>servlet-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
<version>2.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet.jsp</groupId>
|
||||||
|
<artifactId>jsp-api</artifactId>
|
||||||
|
<scope>provided</scope>
|
||||||
|
<version>2.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>jstl</artifactId>
|
||||||
|
<version>1.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.annotation</groupId>
|
||||||
|
<artifactId>jsr250-api</artifactId>
|
||||||
|
<version>1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Logging -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>${org.slf4j-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>jcl-over-slf4j</artifactId>
|
||||||
|
<version>${org.slf4j-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
<version>${org.slf4j-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>log4j</groupId>
|
||||||
|
<artifactId>log4j</artifactId>
|
||||||
|
<version>1.3alpha-8</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.lazyluke</groupId>
|
||||||
|
<artifactId>log4jdbc-remix</artifactId>
|
||||||
|
<version>0.2.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MappingJacksonJsonView -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.jackson</groupId>
|
||||||
|
<artifactId>jackson-mapper-asl</artifactId>
|
||||||
|
<version>1.9.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.codehaus.jackson</groupId>
|
||||||
|
<artifactId>jackson-core-asl</artifactId>
|
||||||
|
<version>1.9.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-core</artifactId>
|
||||||
|
<version>2.6.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
<version>2.6.4</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MultipartHttpServletRequset -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-io</groupId>
|
||||||
|
<artifactId>commons-io</artifactId>
|
||||||
|
<version>2.0.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-fileupload</groupId>
|
||||||
|
<artifactId>commons-fileupload</artifactId>
|
||||||
|
<version>1.2.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Apache Codec -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
<version>1.10</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- EgovProperty -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>egovframework.rte</groupId>
|
||||||
|
<artifactId>egovframework.rte.fdl.property</artifactId>
|
||||||
|
<version>2.7.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency> <!-- 페이징처리 위해 추가 -->
|
||||||
|
<groupId>egovframework.rte</groupId>
|
||||||
|
<artifactId>egovframework.rte.ptl.mvc</artifactId>
|
||||||
|
<version>3.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Log4j -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>log4j</groupId>
|
||||||
|
<artifactId>log4j</artifactId>
|
||||||
|
<version>1.2.15</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>javax.mail</groupId>
|
||||||
|
<artifactId>mail</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>javax.jms</groupId>
|
||||||
|
<artifactId>jms</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.sun.jdmk</groupId>
|
||||||
|
<artifactId>jmxtools</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.sun.jmx</groupId>
|
||||||
|
<artifactId>jmxri</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- @Inject -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.inject</groupId>
|
||||||
|
<artifactId>javax.inject</artifactId>
|
||||||
|
<version>1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<version>2.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Test -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.7</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<defaultGoal>install</defaultGoal>
|
||||||
|
<directory>${basedir}/target</directory>
|
||||||
|
<finalName>first</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-eclipse-plugin</artifactId>
|
||||||
|
<version>2.9</version>
|
||||||
|
<configuration>
|
||||||
|
<additionalProjectnatures>
|
||||||
|
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
|
||||||
|
</additionalProjectnatures>
|
||||||
|
<additionalBuildcommands>
|
||||||
|
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
|
||||||
|
</additionalBuildcommands>
|
||||||
|
<downloadSources>true</downloadSources>
|
||||||
|
<downloadJavadocs>true</downloadJavadocs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>${java-version}</source>
|
||||||
|
<target>${java-version}</target>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
<compilerArgument>-Xlint:all</compilerArgument>
|
||||||
|
<showWarnings>true</showWarnings>
|
||||||
|
<showDeprecation>true</showDeprecation>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<configuration>
|
||||||
|
<mainClass>org.test.int1.Main</mainClass>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
<!-- JavaDoc -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-war-plugin</artifactId>
|
||||||
|
<version>3.2.2</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- <?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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/maven-v4_0_0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<groupId>com.company</groupId>
|
||||||
|
<artifactId>first</artifactId>
|
||||||
|
<name>first</name>
|
||||||
|
<packaging>war</packaging>
|
||||||
|
<version>1.0.0-BUILD-SNAPSHOT</version>
|
||||||
|
<properties>
|
||||||
|
<java-version>1.6</java-version>
|
||||||
|
<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
|
||||||
|
<org.aspectj-version>1.6.10</org.aspectj-version>
|
||||||
|
<org.slf4j-version>1.6.6</org.slf4j-version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
Spring
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-context</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
<exclusions>
|
||||||
|
Exclude Commons Logging in favor of SLF4j
|
||||||
|
<exclusion>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-webmvc</artifactId>
|
||||||
|
<version>${org.springframework-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
AspectJ
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.aspectj</groupId>
|
||||||
|
<artifactId>aspectjrt</artifactId>
|
||||||
|
<version>${org.aspectj-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
Logging
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>${org.slf4j-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>jcl-over-slf4j</artifactId>
|
||||||
|
<version>${org.slf4j-version}</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
|
<version>${org.slf4j-version}</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>log4j</groupId>
|
||||||
|
<artifactId>log4j</artifactId>
|
||||||
|
<version>1.2.15</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>javax.mail</groupId>
|
||||||
|
<artifactId>mail</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>javax.jms</groupId>
|
||||||
|
<artifactId>jms</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.sun.jdmk</groupId>
|
||||||
|
<artifactId>jmxtools</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.sun.jmx</groupId>
|
||||||
|
<artifactId>jmxri</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.inject</groupId>
|
||||||
|
<artifactId>javax.inject</artifactId>
|
||||||
|
<version>1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
Servlet
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>servlet-api</artifactId>
|
||||||
|
<version>2.5</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet.jsp</groupId>
|
||||||
|
<artifactId>jsp-api</artifactId>
|
||||||
|
<version>2.1</version>
|
||||||
|
<scope>provided</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.servlet</groupId>
|
||||||
|
<artifactId>jstl</artifactId>
|
||||||
|
<version>1.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
Test
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<version>4.7</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-eclipse-plugin</artifactId>
|
||||||
|
<version>2.9</version>
|
||||||
|
<configuration>
|
||||||
|
<additionalProjectnatures>
|
||||||
|
<projectnature>org.springframework.ide.eclipse.core.springnature</projectnature>
|
||||||
|
</additionalProjectnatures>
|
||||||
|
<additionalBuildcommands>
|
||||||
|
<buildcommand>org.springframework.ide.eclipse.core.springbuilder</buildcommand>
|
||||||
|
</additionalBuildcommands>
|
||||||
|
<downloadSources>true</downloadSources>
|
||||||
|
<downloadJavadocs>true</downloadJavadocs>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
<configuration>
|
||||||
|
<source>1.6</source>
|
||||||
|
<target>1.6</target>
|
||||||
|
<compilerArgument>-Xlint:all</compilerArgument>
|
||||||
|
<showWarnings>true</showWarnings>
|
||||||
|
<showDeprecation>true</showDeprecation>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
|
<artifactId>exec-maven-plugin</artifactId>
|
||||||
|
<version>1.2.1</version>
|
||||||
|
<configuration>
|
||||||
|
<mainClass>org.test.int1.Main</mainClass>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
|
-->
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package first.common.common;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class CommandMap {
|
||||||
|
Map<String,Object> map = new HashMap<String,Object>();
|
||||||
|
|
||||||
|
public Object get(String key){
|
||||||
|
return map.get(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void put(String key, Object value){
|
||||||
|
map.put(key, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object remove(String key){
|
||||||
|
return map.remove(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean containsKey(String key){
|
||||||
|
return map.containsKey(key);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean containsValue(Object value){
|
||||||
|
return map.containsValue(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear(){
|
||||||
|
map.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Entry<String, Object>> entrySet(){
|
||||||
|
return map.entrySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<String> keySet(){
|
||||||
|
return map.keySet();
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEmpty(){
|
||||||
|
return map.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void putAll(Map<? extends String, ?extends Object> m){
|
||||||
|
map.putAll(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String,Object> getMap(){
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package first.common.controller;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import first.common.common.CommandMap;
|
||||||
|
import first.common.service.CommonService;
|
||||||
|
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class CommonController
|
||||||
|
{
|
||||||
|
Logger log = Logger.getLogger(this.getClass());
|
||||||
|
|
||||||
|
@Resource(name="commonService")
|
||||||
|
private CommonService commonService;
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value="/common/downloadFile.do")
|
||||||
|
public void downloadFile(CommandMap commandMap, HttpServletResponse response) throws Exception
|
||||||
|
{ //서버에서 화면으로 응답할때 response
|
||||||
|
Map<String, Object> map = commonService.selectFileInfo(commandMap.getMap());
|
||||||
|
String storedFileName = (String)map.get("STORED_FILE_NAME");
|
||||||
|
String originalFileName = (String)map.get("ORIGINAL_FILE_NAME");
|
||||||
|
|
||||||
|
byte fileByte[] = FileUtils.readFileToByteArray(new File("C:\\dev\\file\\"+storedFileName));
|
||||||
|
|
||||||
|
response.setContentType("application/octet-stream");
|
||||||
|
response.setContentLength(fileByte.length);
|
||||||
|
response.setHeader("Content-Disposition", "attachment; fileName=\"" + URLEncoder.encode(originalFileName,"UTF-8")+"\";");
|
||||||
|
response.getOutputStream().write(fileByte);
|
||||||
|
|
||||||
|
response.getOutputStream().flush();
|
||||||
|
response.getOutputStream().close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
package first.common.dao;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.mybatis.spring.SqlSessionTemplate;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||||
|
|
||||||
|
public class AbstractDAO {
|
||||||
|
protected Log log = LogFactory.getLog(AbstractDAO.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SqlSessionTemplate sqlSession; /* SqlSessionTemplate 는 context-mapper.xml에 정의됨*/
|
||||||
|
|
||||||
|
protected void printQueryId(String queryId) {
|
||||||
|
if(log.isDebugEnabled()){
|
||||||
|
log.debug("\t QueryId \t: " + queryId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object insert(String queryId, Object params){
|
||||||
|
printQueryId(queryId);
|
||||||
|
return sqlSession.insert(queryId, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object update(String queryId, Object params){
|
||||||
|
printQueryId(queryId);
|
||||||
|
return sqlSession.update(queryId, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object delete(String queryId, Object params){
|
||||||
|
printQueryId(queryId);
|
||||||
|
return sqlSession.delete(queryId, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object selectOne(String queryId){
|
||||||
|
printQueryId(queryId);
|
||||||
|
return sqlSession.selectOne(queryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Object selectOne(String queryId, Object params){
|
||||||
|
printQueryId(queryId);
|
||||||
|
return sqlSession.selectOne(queryId, params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
|
public List selectList(String queryId){
|
||||||
|
printQueryId(queryId);
|
||||||
|
return sqlSession.selectList(queryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
|
public List selectList(String queryId, Object params){
|
||||||
|
printQueryId(queryId);
|
||||||
|
return sqlSession.selectList(queryId,params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||||
|
public Map selectPagingList(String queryId, Object params)
|
||||||
|
{
|
||||||
|
printQueryId(queryId);
|
||||||
|
|
||||||
|
Map<String, Object> map = (Map<String, Object>) params;
|
||||||
|
PaginationInfo paginationInfo = null;
|
||||||
|
|
||||||
|
//containsKey 일치여부
|
||||||
|
if(map.containsKey("currentPageNo") == false || StringUtils.isEmpty(map.get("currentPageNo")) == true)
|
||||||
|
map.put("currentPageNo", "1");
|
||||||
|
|
||||||
|
paginationInfo = new PaginationInfo();
|
||||||
|
paginationInfo.setCurrentPageNo(Integer.parseInt(map.get("currentPageNo").toString()));
|
||||||
|
if(map.containsKey("PAGE_ROW") == false || StringUtils.isEmpty(map.get("PAGE_ROW")) == true)
|
||||||
|
{
|
||||||
|
paginationInfo.setRecordCountPerPage(15); //몇개의 행을 보여줄지 셋
|
||||||
|
}else{
|
||||||
|
paginationInfo.setRecordCountPerPage(Integer.parseInt(map.get("PAGE_ROW").toString()));
|
||||||
|
}
|
||||||
|
paginationInfo.setPageSize(10); //페이지 크기 지정 1~10
|
||||||
|
|
||||||
|
int start = paginationInfo.getFirstRecordIndex();
|
||||||
|
int end = start + paginationInfo.getRecordCountPerPage();
|
||||||
|
map.put("START",start+1);
|
||||||
|
map.put("END",end);
|
||||||
|
|
||||||
|
params = map;
|
||||||
|
|
||||||
|
Map<String,Object> returnMap = new HashMap<String,Object>();
|
||||||
|
List<Map<String,Object>> list = sqlSession.selectList(queryId,params);
|
||||||
|
|
||||||
|
if(list.size() == 0){
|
||||||
|
map = new HashMap<String,Object>();
|
||||||
|
map.put("TOTAL_COUNT",0);
|
||||||
|
list.add(map);
|
||||||
|
|
||||||
|
if(paginationInfo != null){
|
||||||
|
paginationInfo.setTotalRecordCount(0);
|
||||||
|
returnMap.put("paginationInfo", paginationInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(paginationInfo != null){
|
||||||
|
paginationInfo.setTotalRecordCount(Integer.parseInt(list.get(0).get("TOTAL_COUNT").toString()));
|
||||||
|
returnMap.put("paginationInfo", paginationInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
returnMap.put("result", list);
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*@SuppressWarnings("unchecked")
|
||||||
|
public Object selectPagingList(String queryId, Object params)
|
||||||
|
{
|
||||||
|
printQueryId(queryId);
|
||||||
|
Map<String, Object> map = (Map<String, Object>)params;
|
||||||
|
|
||||||
|
String strPageIndex = (String)map.get("PAGE_INDEX"); //페이지 번호
|
||||||
|
String strPageRow = (String)map.get("PAGE_ROW"); //페이지 행수
|
||||||
|
int nPageIndex = 0;
|
||||||
|
int nPageRow = 20;
|
||||||
|
|
||||||
|
if(StringUtils.isEmpty(strPageIndex) == false)
|
||||||
|
{
|
||||||
|
nPageIndex = Integer.parseInt(strPageIndex)-1;
|
||||||
|
}
|
||||||
|
if(StringUtils.isEmpty(strPageRow) == false)
|
||||||
|
{
|
||||||
|
nPageRow = Integer.parseInt(strPageRow);
|
||||||
|
}
|
||||||
|
|
||||||
|
map.put("START", (nPageIndex * nPageRow) + 1);
|
||||||
|
map.put("END", (nPageIndex * nPageRow) + nPageRow);
|
||||||
|
|
||||||
|
return sqlSession.selectList(queryId, map);
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package first.common.dao;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository("commonDAO")
|
||||||
|
public class CommonDAO extends AbstractDAO
|
||||||
|
{
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public Map<String, Object> selectFileInfo(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
return (Map<String,Object>)selectOne("common.selectFileInfo", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package first.common.logger;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.aspectj.lang.ProceedingJoinPoint;
|
||||||
|
import org.aspectj.lang.annotation.Around;
|
||||||
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
|
|
||||||
|
@Aspect
|
||||||
|
public class LoggerAspect
|
||||||
|
{
|
||||||
|
protected Log log = LogFactory.getLog(LoggerAspect.class);
|
||||||
|
static String name = "";
|
||||||
|
static String type = "";
|
||||||
|
|
||||||
|
@Around("execution(* first..controller.*Controller.*(..)) or execution(* first..service.*Imple.*(..)) or execution(* first..dao.*DAO.*(..))")
|
||||||
|
public Object logPrint(ProceedingJoinPoint joinPoint) throws Throwable
|
||||||
|
{
|
||||||
|
type = joinPoint.getSignature().getDeclaringTypeName();
|
||||||
|
|
||||||
|
if(type.indexOf("Controller") > -1)
|
||||||
|
{
|
||||||
|
name = "Controller \t: ";
|
||||||
|
}
|
||||||
|
else if(type.indexOf("Service") > -1)
|
||||||
|
{
|
||||||
|
name = "ServiceImpl \t: ";
|
||||||
|
}
|
||||||
|
else if(type.indexOf("DAO") > -1)
|
||||||
|
{
|
||||||
|
name = "DAO \t\t: ";
|
||||||
|
}
|
||||||
|
log.debug(name + type + "." + joinPoint.getSignature().getName() + "()");
|
||||||
|
|
||||||
|
return joinPoint.proceed();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package first.common.logger;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
|
||||||
|
|
||||||
|
|
||||||
|
public class LoggerInterceptor extends HandlerInterceptorAdapter
|
||||||
|
{
|
||||||
|
protected Log log = LogFactory.getLog(LoggerInterceptor.class);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)throws Exception
|
||||||
|
{
|
||||||
|
if(log.isDebugEnabled())
|
||||||
|
{
|
||||||
|
log.debug("================== START ======================");
|
||||||
|
System.out.println("dddddd");
|
||||||
|
log.debug(" Request URI \t : "+request.getRequestURI());
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.preHandle(request, response, handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception
|
||||||
|
{
|
||||||
|
if(log.isDebugEnabled())
|
||||||
|
{
|
||||||
|
log.debug("=================== END =======================");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package first.common.resolver;
|
||||||
|
|
||||||
|
import java.util.Enumeration;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.springframework.core.MethodParameter;
|
||||||
|
import org.springframework.web.bind.support.WebDataBinderFactory;
|
||||||
|
import org.springframework.web.context.request.NativeWebRequest;
|
||||||
|
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||||
|
import org.springframework.web.method.support.ModelAndViewContainer;
|
||||||
|
|
||||||
|
import first.common.common.CommandMap;
|
||||||
|
|
||||||
|
public class CustomMapArgumentResolver implements HandlerMethodArgumentResolver
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public boolean supportsParameter(MethodParameter parameter)
|
||||||
|
{
|
||||||
|
return CommandMap.class.isAssignableFrom(parameter.getParameterType());
|
||||||
|
} //컨트롤러의 파라미터가 CommandMap클래스인지 검사
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception
|
||||||
|
{
|
||||||
|
CommandMap commandMap = new CommandMap(); //객체생성
|
||||||
|
|
||||||
|
HttpServletRequest request = (HttpServletRequest)webRequest.getNativeRequest();
|
||||||
|
Enumeration<?> enumeration = request.getParameterNames();
|
||||||
|
|
||||||
|
String key = null;
|
||||||
|
String[] values = null;
|
||||||
|
while(enumeration.hasMoreElements())
|
||||||
|
{
|
||||||
|
key = (String)enumeration.nextElement();
|
||||||
|
values = request.getParameterValues(key);
|
||||||
|
|
||||||
|
if(values != null)
|
||||||
|
{
|
||||||
|
commandMap.put(key, (values.length > 1)?values:values[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return commandMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package first.common.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface CommonService
|
||||||
|
{
|
||||||
|
Map<String, Object> selectFileInfo(Map<String, Object> map) throws Exception;
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package first.common.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import first.common.dao.CommonDAO;
|
||||||
|
|
||||||
|
|
||||||
|
@Service("commonService")
|
||||||
|
public class CommonServiceImpl implements CommonService
|
||||||
|
{
|
||||||
|
Logger log = Logger.getLogger(this.getClass());
|
||||||
|
|
||||||
|
@Resource(name="commonDAO")
|
||||||
|
private CommonDAO commonDAO;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> selectFileInfo(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
return commonDAO.selectFileInfo(map);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package first.common.util;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class CommonUtils
|
||||||
|
{
|
||||||
|
public static String getRandomString()
|
||||||
|
{
|
||||||
|
return UUID.randomUUID().toString().replaceAll("-", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,85 @@
|
|||||||
|
package first.common.util;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
|
||||||
|
@Component("fileUtils")
|
||||||
|
public class FileUtils
|
||||||
|
{
|
||||||
|
private static final String filePath = "c:\\dev\\file\\"; //파일 저장위치 선언
|
||||||
|
|
||||||
|
public List<Map<String, Object>> parseInsertFileInfo(Map<String, Object> map, HttpServletRequest request) throws Exception
|
||||||
|
{
|
||||||
|
MultipartHttpServletRequest multipartHttpServletRequest = (MultipartHttpServletRequest)request;
|
||||||
|
Iterator<String> iterator = multipartHttpServletRequest.getFileNames();
|
||||||
|
|
||||||
|
MultipartFile multipartFile = null;
|
||||||
|
String originalFileName = null;
|
||||||
|
String originalFileExtension = null;
|
||||||
|
String storedFileName = null;
|
||||||
|
|
||||||
|
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
|
||||||
|
Map<String, Object> listMap = null;
|
||||||
|
|
||||||
|
String boardIdx = (String)map.get("IDX"); //게시글 번호 받아오는 부분
|
||||||
|
String requestName = null;
|
||||||
|
String idx = null;
|
||||||
|
|
||||||
|
/*File file = new File(filePath);
|
||||||
|
if(file.exists() == false)
|
||||||
|
{
|
||||||
|
file.mkdirs();
|
||||||
|
} //경로 없으면 만들어줘라
|
||||||
|
*/
|
||||||
|
while(iterator.hasNext())
|
||||||
|
{
|
||||||
|
multipartFile = multipartHttpServletRequest.getFile(iterator.next());
|
||||||
|
if(multipartFile.isEmpty() == false)
|
||||||
|
{
|
||||||
|
originalFileName = multipartFile.getOriginalFilename();
|
||||||
|
originalFileExtension = originalFileName.substring(originalFileName.lastIndexOf(".")); //확장자명을 짤라서 저장하고
|
||||||
|
storedFileName = CommonUtils.getRandomString() + originalFileExtension; //파일이름 랜덤하고 돌리고 짤랐던거 확장자 붙이고,
|
||||||
|
|
||||||
|
/*file = new File(filePath + storedFileName);
|
||||||
|
multipartFile.transferTo(file);*/
|
||||||
|
|
||||||
|
multipartFile.transferTo(new File(filePath + storedFileName));
|
||||||
|
|
||||||
|
listMap = new HashMap<String, Object>();
|
||||||
|
/*listMap.put("BOARD_IDX", boardIdx);
|
||||||
|
listMap.put("ORIGINAL_FILE_NAME", originalFileName);
|
||||||
|
listMap.put("STORED_FILE_NAME", storedFileName);
|
||||||
|
listMap.put("FILE_SIZE", multipartFile.getSize());*/
|
||||||
|
|
||||||
|
listMap.put("IS_NEW", "Y");
|
||||||
|
listMap.put("BOARD_IDX", boardIdx);
|
||||||
|
listMap.put("ORIGINAL_FILE_NAME", originalFileName);
|
||||||
|
listMap.put("STORED_FILE_NAME", storedFileName);
|
||||||
|
listMap.put("FILE_SIZE", multipartFile.getSize());
|
||||||
|
list.add(listMap);
|
||||||
|
}else{
|
||||||
|
requestName = multipartFile.getName();
|
||||||
|
idx = "IDX_" + requestName.substring(requestName.indexOf("_")+1);
|
||||||
|
if(map.containsKey(idx)==true&&map.get(idx)!=null)
|
||||||
|
{
|
||||||
|
listMap = new HashMap<String,Object>();
|
||||||
|
listMap.put("IS_NEW", "N");
|
||||||
|
listMap.put("FILE_IDX", map.get(idx));
|
||||||
|
list.add(listMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
package first.sample.controller;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.springframework.stereotype.Controller;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonCreator.Mode;
|
||||||
|
|
||||||
|
import egovframework.rte.ptl.mvc.tags.ui.pagination.PaginationInfo;
|
||||||
|
import first.common.common.CommandMap;
|
||||||
|
import first.sample.service.SampleService;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
public class SampleController
|
||||||
|
{
|
||||||
|
Logger log = Logger.getLogger(this.getClass()); //로그 찍고
|
||||||
|
|
||||||
|
@Resource(name="sampleService")
|
||||||
|
private SampleService sampleService; //샘플서비스 선언하고
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/openBoardSearch.do")
|
||||||
|
public ModelAndView openBoardSearch(CommandMap commandMap) throws Exception
|
||||||
|
{
|
||||||
|
ModelAndView mv = new ModelAndView("/sample/boardSearch");
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/openBoardList.do") //경로 맵핑해주고~
|
||||||
|
public ModelAndView openBoardList(CommandMap commandMap) throws Exception
|
||||||
|
{ //모델뷰 만들고 openSampleBoardList 메서드 만들고
|
||||||
|
ModelAndView mv = new ModelAndView("/sample/boardList"); //모델뷰 객체 선언뒤 jsp파일 지정
|
||||||
|
|
||||||
|
Map<String, Object> resultMap = sampleService.selectBoardList(commandMap.getMap());
|
||||||
|
//List<Map<String, Object>> list = sampleService.selectBoardList(commandMap);
|
||||||
|
//앞에서 샘플서비스 선언한것 뒤에 selectBoardList라는 메서드 만들고
|
||||||
|
//mv.addObject("list", list); //앞에서 실행 다하고 list에 담긴건 list라고 선언하고
|
||||||
|
|
||||||
|
mv.addObject("paginationInfo", (PaginationInfo)resultMap.get("paginationInfo"));
|
||||||
|
mv.addObject("list", resultMap.get("result"));
|
||||||
|
|
||||||
|
System.out.println("========JRebel Test============");
|
||||||
|
log.debug("======JRebel Test2======");
|
||||||
|
|
||||||
|
return mv;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/testMapArgumentResolver.do")
|
||||||
|
public ModelAndView testMapArgumentResolver(CommandMap commandMap) throws Exception
|
||||||
|
{
|
||||||
|
ModelAndView mv = new ModelAndView("");
|
||||||
|
|
||||||
|
if(commandMap.isEmpty() == false)
|
||||||
|
{
|
||||||
|
Iterator<Entry<String,Object>> iterator = commandMap.getMap().entrySet().iterator();
|
||||||
|
Entry<String,Object> entry = null;
|
||||||
|
while(iterator.hasNext())
|
||||||
|
{
|
||||||
|
entry = iterator.next();
|
||||||
|
log.debug("key :"+entry.getKey()+", value :"+entry.getValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/openBoardWrite.do")
|
||||||
|
public ModelAndView openBoardWrite(CommandMap commandMap) throws Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
ModelAndView mv = new ModelAndView("/sample/boardWrite"); //JSP 파일 지정
|
||||||
|
System.out.println("========JRebel Test============");
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/Test.do")
|
||||||
|
public ModelAndView Test(CommandMap commandMap) throws Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
ModelAndView mv = new ModelAndView("/sample/Test"); //JSP 파일 지정
|
||||||
|
System.out.println("========Test Test============");
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/kk.do")
|
||||||
|
public ModelAndView kk(CommandMap commandMap) throws Exception
|
||||||
|
{
|
||||||
|
|
||||||
|
ModelAndView mv = new ModelAndView("/sample/kk"); //JSP 파일 지정
|
||||||
|
System.out.println("========kk Test============");
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/insertBoard.do")
|
||||||
|
public ModelAndView insertBoard(CommandMap commandMap, HttpServletRequest request) throws Exception
|
||||||
|
{
|
||||||
|
ModelAndView mv = new ModelAndView("redirect:/sample/openBoardList.do");
|
||||||
|
|
||||||
|
sampleService.insertBoard(commandMap.getMap(), request);
|
||||||
|
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/openBoardDetail.do")
|
||||||
|
public ModelAndView openBoardDetail(CommandMap commandMap) throws Exception
|
||||||
|
{
|
||||||
|
ModelAndView mv = new ModelAndView("/sample/boardDetail");
|
||||||
|
|
||||||
|
Map<String,Object> map = sampleService.selectBoardDetail(commandMap.getMap());
|
||||||
|
|
||||||
|
mv.addObject("map", map.get("map"));
|
||||||
|
mv.addObject("list", map.get("list")); //요건 첨부파일 목록 부를때 쓸거임
|
||||||
|
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/openBoardUpdate.do") //수정디테일화면
|
||||||
|
public ModelAndView openBoardUpdate(CommandMap commandMap) throws Exception
|
||||||
|
{
|
||||||
|
ModelAndView mv = new ModelAndView("/sample/boardUpdate");
|
||||||
|
|
||||||
|
Map<String, Object> map = sampleService.boardUpdate(commandMap.getMap());
|
||||||
|
|
||||||
|
mv.addObject("map", map.get("map")); //내용
|
||||||
|
mv.addObject("list", map.get("list")); //첨부파일
|
||||||
|
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/updateBoard.do") //수정하기 누르는~~ 혹은 저장하기 누르는~~
|
||||||
|
public ModelAndView updateBoard(CommandMap commandMap, HttpServletRequest request) throws Exception
|
||||||
|
{
|
||||||
|
ModelAndView mv = new ModelAndView("redirect:/sample/openBoardDetail.do");
|
||||||
|
|
||||||
|
sampleService.updateBoard(commandMap.getMap(), request);
|
||||||
|
|
||||||
|
mv.addObject("IDX", commandMap.get("IDX"));
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value="/sample/deleteBoard.do")
|
||||||
|
public ModelAndView deleteBoard(CommandMap commandMap) throws Exception
|
||||||
|
{
|
||||||
|
ModelAndView mv = new ModelAndView("redirect:/sample/openBoardList.do");
|
||||||
|
|
||||||
|
sampleService.deleteBoard(commandMap.getMap());
|
||||||
|
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
package first.sample.dao;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
import first.common.dao.AbstractDAO;
|
||||||
|
|
||||||
|
@Repository("sampleDAO") //@Repository DAO선언시 주로 사용
|
||||||
|
public class SampleDAO extends AbstractDAO //오 요건 extends로 상속 받았으니 그대로 쓰면됨
|
||||||
|
{
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked") //에러 경고문 필요없음
|
||||||
|
public Map<String, Object> selectBoardList(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
//return (List<Map<String, Object>>) selectList("sample.selectBoardList", map);
|
||||||
|
//첫번째 인자값이 쿼리 이름 -> sample.selectBoardList
|
||||||
|
return (Map<String, Object>) selectPagingList("sample.selectBoardList", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertBoard(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
insert("sample.insertBoard", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertFile(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
insert("sample.insertFile", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*public void updateHitCnt(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
update("sample.updateHitCnt", map);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public Map<String, Object> selectBoardDetail(Map<String, Object> map) throws Exception{
|
||||||
|
return (Map<String, Object>) selectOne("sample.selectBoardDetail", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public List<Map<String, Object>> selectFileList(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
return (List<Map<String, Object>>) selectList("sample.selectFileList", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public Map<String, Object> boardUpdate(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
return (Map<String, Object>) selectOne("sample.boardUpdate", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateBoard(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
update("sample.updateBoard", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteBoard(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
delete("sample.deleteBoard", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateHitCnt(Map<String, Object> map)
|
||||||
|
{
|
||||||
|
update("sample.updateHitCnt", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void deleteFileList(Map<String, Object> map)
|
||||||
|
{
|
||||||
|
update("sample.deleteFileList", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateFile(Map<String, Object> map)
|
||||||
|
{
|
||||||
|
update("sample.updateFile", map);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package first.sample.service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
public interface SampleService {
|
||||||
|
|
||||||
|
Map<String, Object> selectBoardList(Map<String, Object> map) throws Exception;
|
||||||
|
|
||||||
|
void insertBoard(Map<String, Object> map, HttpServletRequest request) throws Exception;
|
||||||
|
|
||||||
|
Map<String, Object> selectBoardDetail(Map<String, Object> map) throws Exception;
|
||||||
|
|
||||||
|
Map<String, Object> boardUpdate(Map<String, Object> map) throws Exception;
|
||||||
|
|
||||||
|
void updateBoard(Map<String, Object> map, HttpServletRequest request) throws Exception;
|
||||||
|
|
||||||
|
void deleteBoard(Map<String, Object> map) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
package first.sample.service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
|
||||||
|
import first.common.util.FileUtils;
|
||||||
|
import first.sample.dao.SampleDAO;
|
||||||
|
|
||||||
|
|
||||||
|
@Service("sampleService")
|
||||||
|
public class SampleServiceImpl implements SampleService //인터페이스 상속시 implements
|
||||||
|
{ //SampleSeriveImpl 클래스 선언하는데 SampleSerive
|
||||||
|
Logger log = Logger.getLogger(this.getClass()); //로그 한번 찍어주고
|
||||||
|
|
||||||
|
@Resource(name="fileUtils")
|
||||||
|
private FileUtils fileUtils;
|
||||||
|
|
||||||
|
@Resource(name="sampleDAO")
|
||||||
|
private SampleDAO sampleDAO; //SampleDAO 선언해주고
|
||||||
|
|
||||||
|
@Override //implements로 상속 받았으니 @Override로 재 정의해줌(SampleService에서 정의한놈)
|
||||||
|
public Map<String, Object> selectBoardList(Map<String, Object> map) throws Exception {
|
||||||
|
|
||||||
|
return sampleDAO.selectBoardList(map);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void insertBoard(Map<String, Object> map, HttpServletRequest request) throws Exception
|
||||||
|
{
|
||||||
|
sampleDAO.insertBoard(map);
|
||||||
|
|
||||||
|
List<Map<String, Object>> list = fileUtils.parseInsertFileInfo(map, request);
|
||||||
|
for(int i=0,size=list.size();i<size;i++)
|
||||||
|
{
|
||||||
|
sampleDAO.insertFile(list.get(i));
|
||||||
|
}
|
||||||
|
|
||||||
|
MultipartHttpServletRequest multipartHttpServletRequest = (MultipartHttpServletRequest)request;
|
||||||
|
Iterator<String> iterator = multipartHttpServletRequest.getFileNames();
|
||||||
|
MultipartFile multipartFile = null;
|
||||||
|
|
||||||
|
while(iterator.hasNext())
|
||||||
|
{
|
||||||
|
multipartFile = multipartHttpServletRequest.getFile(iterator.next());
|
||||||
|
|
||||||
|
if(multipartFile.isEmpty() == false)
|
||||||
|
{
|
||||||
|
log.debug("--------------file start------------");
|
||||||
|
log.debug("name :" + multipartFile.getName());
|
||||||
|
log.debug("filename :" + multipartFile.getOriginalFilename());
|
||||||
|
log.debug("size :" + multipartFile.getSize());
|
||||||
|
log.debug("--------------file end--------------\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> selectBoardDetail(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
sampleDAO.updateHitCnt(map);
|
||||||
|
|
||||||
|
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||||
|
Map<String, Object> tempMap = sampleDAO.selectBoardDetail(map);
|
||||||
|
resultMap.put("map", tempMap);
|
||||||
|
|
||||||
|
List<Map<String, Object>> list = sampleDAO.selectFileList(map);
|
||||||
|
resultMap.put("list", list);
|
||||||
|
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> boardUpdate(Map<String, Object> map) throws Exception
|
||||||
|
{
|
||||||
|
Map<String, Object> resultMap = new HashMap<String, Object>();
|
||||||
|
Map<String, Object> tempMap = sampleDAO.boardUpdate(map);
|
||||||
|
resultMap.put("map", tempMap);
|
||||||
|
|
||||||
|
List<Map<String, Object>> list = sampleDAO.selectFileList(map);
|
||||||
|
resultMap.put("list", list);
|
||||||
|
|
||||||
|
return resultMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateBoard(Map<String, Object> map, HttpServletRequest request) throws Exception
|
||||||
|
{
|
||||||
|
sampleDAO.updateBoard(map); //기존 글만 수정(업데이트)
|
||||||
|
|
||||||
|
sampleDAO.deleteFileList(map); // (DEL_GB = 'Y') 로 처리하는 부분
|
||||||
|
List<Map<String, Object>> list = fileUtils.parseInsertFileInfo(map, request);
|
||||||
|
Map<String, Object> tempMap = null;
|
||||||
|
for(int i=0,size=list.size();i<size;i++)
|
||||||
|
{
|
||||||
|
tempMap = list.get(i);
|
||||||
|
if(tempMap.get("IS_NEW").equals("Y"))
|
||||||
|
{
|
||||||
|
sampleDAO.insertFile(tempMap);
|
||||||
|
}else{
|
||||||
|
sampleDAO.updateFile(tempMap);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteBoard(Map<String, Object> map) throws Exception {
|
||||||
|
|
||||||
|
sampleDAO.deleteBoard(map);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package test;
|
||||||
|
|
||||||
|
public class test {
|
||||||
|
|
||||||
|
public static void main(String[] args)
|
||||||
|
{
|
||||||
|
try{
|
||||||
|
String str = "abc";
|
||||||
|
Integer.parseInt(str);
|
||||||
|
}catch(Exception e){
|
||||||
|
System.out.println("Error");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?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:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:aop="http://www.springframework.org/schema/aop"
|
||||||
|
xsi:schemaLocation="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.xsd
|
||||||
|
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
|
||||||
|
|
||||||
|
<aop:aspectj-autoproxy/>
|
||||||
|
<bean id="loggerAspect" class="first.common.logger.LoggerAspect" />
|
||||||
|
</beans>
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:p="http://www.springframework.org/schema/p"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||||
|
xmlns:cache="http://www.springframework.org/schema/cache"
|
||||||
|
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.xsd
|
||||||
|
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
|
||||||
|
|
||||||
|
<context:component-scan base-package="first">
|
||||||
|
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
|
||||||
|
</context:component-scan>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- MultipartResolver 설정 -->
|
||||||
|
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
||||||
|
<property name="maxUploadSize" value="100000000" />
|
||||||
|
<property name="maxInMemorySize" value="100000000" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- 페이징 bean 설정 -->
|
||||||
|
<bean id="textRenderer" class="egovframework.rte.ptl.mvc.tags.ui.pagination.DefaultPaginationRenderer"/>
|
||||||
|
<bean id="paginationManager" class="egovframework.rte.ptl.mvc.tags.ui.pagination.DefaultPaginationManager">
|
||||||
|
<property name="rendererType">
|
||||||
|
<map>
|
||||||
|
<entry key="text" value-ref="textRenderer"/>
|
||||||
|
</map>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||||
|
http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd">
|
||||||
|
|
||||||
|
|
||||||
|
<bean id="dataSourceSpied" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
|
||||||
|
<property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
|
||||||
|
<property name="url" value="jdbc:oracle:thin:@192.168.31.2:1521:xe"/>
|
||||||
|
<property name="username" value="scott"/>
|
||||||
|
<property name="password" value="tiger"/>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<!-- Mybatis 와 DB 연결 -->
|
||||||
|
|
||||||
|
<bean id="dataSource" class="net.sf.log4jdbc.Log4jdbcProxyDataSource">
|
||||||
|
<constructor-arg ref="dataSourceSpied" />
|
||||||
|
<property name="logFormatter">
|
||||||
|
<bean class="net.sf.log4jdbc.tools.Log4JdbcCustomFormatter">
|
||||||
|
<property name="loggingType" value="MULTI_LINE" />
|
||||||
|
<property name="sqlPrefix" value="SQL : "/>
|
||||||
|
</bean>
|
||||||
|
</property>
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
</beans>
|
||||||
|
|
||||||
|
<!-- oracle.jdbc.driver.OracleDriver --> <!-- 오타 실수 주의! -->
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
<?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:context="http://www.springframework.org/schema/context"
|
||||||
|
xsi:schemaLocation="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.xsd">
|
||||||
|
|
||||||
|
<bean id="sqlSession" class="org.mybatis.spring.SqlSessionFactoryBean">
|
||||||
|
<property name="dataSource" ref="dataSource" />
|
||||||
|
<property name="mapperLocations" value="classpath:/mapper/**/*_SQL.xml" />
|
||||||
|
</bean>
|
||||||
|
|
||||||
|
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
|
||||||
|
<constructor-arg index="0" ref="sqlSession"/>
|
||||||
|
</bean>
|
||||||
|
<!-- myBatis와 spring 연결 -->
|
||||||
|
</beans>
|
||||||
@@ -0,0 +1,237 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!--
|
||||||
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
contributor license agreements. See the NOTICE file distributed with
|
||||||
|
this work for additional information regarding copyright ownership.
|
||||||
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
(the "License"); you may not use this file except in compliance with
|
||||||
|
the License. You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<!-- Authors: Chris Taylor, Ceki Gulcu. -->
|
||||||
|
|
||||||
|
<!-- Version: 1.2 -->
|
||||||
|
|
||||||
|
<!-- A configuration element consists of optional renderer
|
||||||
|
elements,appender elements, categories and an optional root
|
||||||
|
element. -->
|
||||||
|
|
||||||
|
<!ELEMENT log4j:configuration (renderer*, throwableRenderer?,
|
||||||
|
appender*,plugin*, (category|logger)*,root?,
|
||||||
|
(categoryFactory|loggerFactory)?)>
|
||||||
|
|
||||||
|
<!-- The "threshold" attribute takes a level value below which -->
|
||||||
|
<!-- all logging statements are disabled. -->
|
||||||
|
|
||||||
|
<!-- Setting the "debug" enable the printing of internal log4j logging -->
|
||||||
|
<!-- statements. -->
|
||||||
|
|
||||||
|
<!-- By default, debug attribute is "null", meaning that we not do touch -->
|
||||||
|
<!-- internal log4j logging settings. The "null" value for the threshold -->
|
||||||
|
<!-- attribute can be misleading. The threshold field of a repository -->
|
||||||
|
<!-- cannot be set to null. The "null" value for the threshold attribute -->
|
||||||
|
<!-- simply means don't touch the threshold field, the threshold field -->
|
||||||
|
<!-- keeps its old value. -->
|
||||||
|
|
||||||
|
<!ATTLIST log4j:configuration
|
||||||
|
xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/"
|
||||||
|
threshold (all|trace|debug|info|warn|error|fatal|off|null) "null"
|
||||||
|
debug (true|false|null) "null"
|
||||||
|
reset (true|false) "false"
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- renderer elements allow the user to customize the conversion of -->
|
||||||
|
<!-- message objects to String. -->
|
||||||
|
|
||||||
|
<!ELEMENT renderer EMPTY>
|
||||||
|
<!ATTLIST renderer
|
||||||
|
renderedClass CDATA #REQUIRED
|
||||||
|
renderingClass CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- throwableRenderer allows the user to customize the conversion
|
||||||
|
of exceptions to a string representation. -->
|
||||||
|
<!ELEMENT throwableRenderer (param*)>
|
||||||
|
<!ATTLIST throwableRenderer
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Appenders must have a name and a class. -->
|
||||||
|
<!-- Appenders may contain an error handler, a layout, optional parameters -->
|
||||||
|
<!-- and filters. They may also reference (or include) other appenders. -->
|
||||||
|
<!ELEMENT appender (errorHandler?, param*,
|
||||||
|
rollingPolicy?, triggeringPolicy?, connectionSource?,
|
||||||
|
layout?, filter*, appender-ref*)>
|
||||||
|
<!ATTLIST appender
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT layout (param*)>
|
||||||
|
<!ATTLIST layout
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT filter (param*)>
|
||||||
|
<!ATTLIST filter
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- ErrorHandlers can be of any class. They can admit any number of -->
|
||||||
|
<!-- parameters. -->
|
||||||
|
|
||||||
|
<!ELEMENT errorHandler (param*, root-ref?, logger-ref*, appender-ref?)>
|
||||||
|
<!ATTLIST errorHandler
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT root-ref EMPTY>
|
||||||
|
|
||||||
|
<!ELEMENT logger-ref EMPTY>
|
||||||
|
<!ATTLIST logger-ref
|
||||||
|
ref CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT param EMPTY>
|
||||||
|
<!ATTLIST param
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
value CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- The priority class is org.apache.log4j.Level by default -->
|
||||||
|
<!ELEMENT priority (param*)>
|
||||||
|
<!ATTLIST priority
|
||||||
|
class CDATA #IMPLIED
|
||||||
|
value CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- The level class is org.apache.log4j.Level by default -->
|
||||||
|
<!ELEMENT level (param*)>
|
||||||
|
<!ATTLIST level
|
||||||
|
class CDATA #IMPLIED
|
||||||
|
value CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- If no level element is specified, then the configurator MUST not -->
|
||||||
|
<!-- touch the level of the named category. -->
|
||||||
|
<!ELEMENT category (param*,(priority|level)?,appender-ref*)>
|
||||||
|
<!ATTLIST category
|
||||||
|
class CDATA #IMPLIED
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
additivity (true|false) "true"
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- If no level element is specified, then the configurator MUST not -->
|
||||||
|
<!-- touch the level of the named logger. -->
|
||||||
|
<!ELEMENT logger (param*,level?,appender-ref*)>
|
||||||
|
<!ATTLIST logger
|
||||||
|
class CDATA #IMPLIED
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
additivity (true|false) "true"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<!ELEMENT categoryFactory (param*)>
|
||||||
|
<!ATTLIST categoryFactory
|
||||||
|
class CDATA #REQUIRED>
|
||||||
|
|
||||||
|
<!ELEMENT loggerFactory (param*)>
|
||||||
|
<!ATTLIST loggerFactory
|
||||||
|
class CDATA #REQUIRED>
|
||||||
|
|
||||||
|
<!ELEMENT appender-ref EMPTY>
|
||||||
|
<!ATTLIST appender-ref
|
||||||
|
ref CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- plugins must have a name and class and can have optional parameters -->
|
||||||
|
<!ELEMENT plugin (param*, connectionSource?)>
|
||||||
|
<!ATTLIST plugin
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT connectionSource (dataSource?, param*)>
|
||||||
|
<!ATTLIST connectionSource
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT dataSource (param*)>
|
||||||
|
<!ATTLIST dataSource
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT triggeringPolicy ((param|filter)*)>
|
||||||
|
<!ATTLIST triggeringPolicy
|
||||||
|
name CDATA #IMPLIED
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT rollingPolicy (param*)>
|
||||||
|
<!ATTLIST rollingPolicy
|
||||||
|
name CDATA #IMPLIED
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- If no priority element is specified, then the configurator MUST not -->
|
||||||
|
<!-- touch the priority of root. -->
|
||||||
|
<!-- The root category always exists and cannot be subclassed. -->
|
||||||
|
<!ELEMENT root (param*, (priority|level)?, appender-ref*)>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ==================================================================== -->
|
||||||
|
<!-- A logging event -->
|
||||||
|
<!-- ==================================================================== -->
|
||||||
|
<!ELEMENT log4j:eventSet (log4j:event*)>
|
||||||
|
<!ATTLIST log4j:eventSet
|
||||||
|
xmlns:log4j CDATA #FIXED "http://jakarta.apache.org/log4j/"
|
||||||
|
version (1.1|1.2) "1.2"
|
||||||
|
includesLocationInfo (true|false) "true"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!ELEMENT log4j:event (log4j:message, log4j:NDC?, log4j:throwable?,
|
||||||
|
log4j:locationInfo?, log4j:properties?) >
|
||||||
|
|
||||||
|
<!-- The timestamp format is application dependent. -->
|
||||||
|
<!ATTLIST log4j:event
|
||||||
|
logger CDATA #REQUIRED
|
||||||
|
level CDATA #REQUIRED
|
||||||
|
thread CDATA #REQUIRED
|
||||||
|
timestamp CDATA #REQUIRED
|
||||||
|
time CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT log4j:message (#PCDATA)>
|
||||||
|
<!ELEMENT log4j:NDC (#PCDATA)>
|
||||||
|
|
||||||
|
<!ELEMENT log4j:throwable (#PCDATA)>
|
||||||
|
|
||||||
|
<!ELEMENT log4j:locationInfo EMPTY>
|
||||||
|
<!ATTLIST log4j:locationInfo
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
method CDATA #REQUIRED
|
||||||
|
file CDATA #REQUIRED
|
||||||
|
line CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT log4j:properties (log4j:data*)>
|
||||||
|
|
||||||
|
<!ELEMENT log4j:data EMPTY>
|
||||||
|
<!ATTLIST log4j:data
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
value CDATA #REQUIRED
|
||||||
|
>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE log4j:configuration PUBLIC "-//APACHE//DTD LOG4J 1.2//EN" "log4j.dtd">
|
||||||
|
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
|
||||||
|
|
||||||
|
<!-- Appenders -->
|
||||||
|
<appender name="console" class="org.apache.log4j.ConsoleAppender">
|
||||||
|
<layout class="org.apache.log4j.PatternLayout">
|
||||||
|
<param name="ConversionPattern" value="%d %5p [%c] %m%n" />
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="console-infolog" class="org.apache.log4j.ConsoleAppender">
|
||||||
|
<layout class="org.apache.log4j.PatternLayout">
|
||||||
|
<param name="ConversionPattern" value="%d %5p %m%n" />
|
||||||
|
</layout>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- Application Loggers -->
|
||||||
|
<logger name="first" additivity="false">
|
||||||
|
<level value="debug" />
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- Query Loggers -->
|
||||||
|
<logger name="jdbc.sqlonly" additivity="false">
|
||||||
|
<level value="INFO"/>
|
||||||
|
<appender-ref ref="console-infolog"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<logger name="jdbc.resultsettable" additivity="false">
|
||||||
|
<level value="INFO"/>
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</logger>
|
||||||
|
|
||||||
|
<!-- Root Logger -->
|
||||||
|
<root>
|
||||||
|
<priority value="off"/>
|
||||||
|
<appender-ref ref="console" />
|
||||||
|
</root>
|
||||||
|
|
||||||
|
</log4j:configuration>
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="common">
|
||||||
|
|
||||||
|
<select id="selectFileInfo" parameterType="hashmap" resultType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
STORED_FILE_NAME,
|
||||||
|
ORIGINAL_FILE_NAME
|
||||||
|
FROM
|
||||||
|
TB_FILE
|
||||||
|
WHERE
|
||||||
|
IDX=#{IDX}
|
||||||
|
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<sql id="pagingPre">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
AAA.*
|
||||||
|
FROM(
|
||||||
|
SELECT
|
||||||
|
COUNT(*) OVER() AS TOTAL_COUNT,
|
||||||
|
AA.*
|
||||||
|
FROM(
|
||||||
|
]]>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<sql id="pagingPost">
|
||||||
|
<![CDATA[
|
||||||
|
) AA
|
||||||
|
) AAA
|
||||||
|
WHERE
|
||||||
|
AAA.RNUM BETWEEN #{START} AND #{END}
|
||||||
|
]]>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,188 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
|
||||||
|
<mapper namespace="sample">
|
||||||
|
<select id="selectBoardList" parameterType="hashmap" resultType="hashmap">
|
||||||
|
<include refid="common.pagingPre"/>
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
ROW_NUMBER() OVER (ORDER BY IDX DESC) RNUM,
|
||||||
|
IDX,
|
||||||
|
TITLE,
|
||||||
|
HIT_CNT,
|
||||||
|
CREA_DTM
|
||||||
|
FROM
|
||||||
|
TB_BOARD
|
||||||
|
WHERE
|
||||||
|
DEL_GB = 'N'
|
||||||
|
]]>
|
||||||
|
<include refid="common.pagingPost"/>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertBoard" parameterType="hashmap" useGeneratedKeys="true" keyProperty="IDX">
|
||||||
|
<selectKey keyProperty="IDX" resultType="string" order="BEFORE">
|
||||||
|
SELECT SEQ_TB_BOARD_IDX.NEXTVAL FROM DUAL
|
||||||
|
</selectKey>
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO TB_BOARD
|
||||||
|
(
|
||||||
|
IDX,
|
||||||
|
TITLE,
|
||||||
|
CONTENTS,
|
||||||
|
HIT_CNT,
|
||||||
|
DEL_GB,
|
||||||
|
CREA_DTM,
|
||||||
|
CREA_ID
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
#{IDX},
|
||||||
|
#{TITLE,jdbcType=VARCHAR},
|
||||||
|
#{CONTENTS,jdbcType=VARCHAR},
|
||||||
|
0,
|
||||||
|
'N',
|
||||||
|
SYSDATE,
|
||||||
|
'Admin'
|
||||||
|
)
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!-- <update id="updateHitCnt" parameterType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE TB_BOARD
|
||||||
|
SET
|
||||||
|
HIT_CNT = NVL(HIT_CNT,0)+1
|
||||||
|
WHERE
|
||||||
|
IDX=#{IDX]
|
||||||
|
]]>
|
||||||
|
</update> --><!-- HIT_CNT 가 null일경우, 두번째 반환 -->
|
||||||
|
|
||||||
|
<update id="updateHitCnt" parameterType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE TB_BOARD
|
||||||
|
SET HIT_CNT = HIT_CNT + 1
|
||||||
|
WHERE IDX=#{IDX}
|
||||||
|
]]>
|
||||||
|
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<select id="selectBoardDetail" parameterType="hashmap" resultType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
IDX,
|
||||||
|
HIT_CNT,
|
||||||
|
CREA_ID,
|
||||||
|
CREA_DTM,
|
||||||
|
TITLE,
|
||||||
|
CONTENTS
|
||||||
|
FROM
|
||||||
|
TB_BOARD
|
||||||
|
WHERE
|
||||||
|
IDX=#{IDX}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="boardUpdate" parameterType="hashmap" resultType="hashmap">
|
||||||
|
<!-- <![CDATA[
|
||||||
|
UPDATE TB_BOARD
|
||||||
|
SET
|
||||||
|
TITLE = #{TITLE},
|
||||||
|
CONTENTS = #{CONTENTS}
|
||||||
|
WHERE
|
||||||
|
IDX = #{IDX}
|
||||||
|
]]> -->
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
IDX,
|
||||||
|
HIT_CNT,
|
||||||
|
CREA_ID,
|
||||||
|
CREA_DTM,
|
||||||
|
TITLE,
|
||||||
|
CONTENTS
|
||||||
|
FROM
|
||||||
|
TB_BOARD
|
||||||
|
WHERE IDX=#{IDX}
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateBoard" parameterType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE TB_BOARD
|
||||||
|
SET TITLE=#{TITLE},
|
||||||
|
CONTENTS=#{CONTENTS}
|
||||||
|
WHERE
|
||||||
|
IDX=#{IDX}
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteBoard" parameterType="hashmap">
|
||||||
|
<!-- <![CDATA[
|
||||||
|
DELETE FROM
|
||||||
|
TB_BOARD
|
||||||
|
WHERE IDX=#{IDX}
|
||||||
|
]]> -->
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE TB_BOARD
|
||||||
|
SET DEL_GB = 'Y'
|
||||||
|
WHERE IDX=#{IDX}
|
||||||
|
]]>
|
||||||
|
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<insert id="insertFile" parameterType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
INSERT INTO TB_FILE
|
||||||
|
(
|
||||||
|
IDX,
|
||||||
|
BOARD_IDX,
|
||||||
|
ORIGINAL_FILE_NAME,
|
||||||
|
STORED_FILE_NAME,
|
||||||
|
FILE_SIZE,
|
||||||
|
CREA_ID
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
SEQ_TB_FILE_IDX.NEXTVAL,
|
||||||
|
#{BOARD_IDX},
|
||||||
|
#{ORIGINAL_FILE_NAME},
|
||||||
|
#{STORED_FILE_NAME},
|
||||||
|
#{FILE_SIZE},
|
||||||
|
'Admin'
|
||||||
|
)
|
||||||
|
]]>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<select id="selectFileList" parameterType="hashmap" resultType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
SELECT
|
||||||
|
IDX,
|
||||||
|
ORIGINAL_FILE_NAME,
|
||||||
|
ROUND(FILE_SIZE/1024,1) AS FILE_SIZE
|
||||||
|
FROM
|
||||||
|
TB_FILE
|
||||||
|
WHERE
|
||||||
|
BOARD_IDX=#{IDX}
|
||||||
|
AND DEL_GB='N'
|
||||||
|
]]>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="deleteFileList" parameterType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE TB_FILE SET
|
||||||
|
DEL_GB='Y'
|
||||||
|
WHERE
|
||||||
|
BOARD_IDX=#{IDX}
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<update id="updateFile" parameterType="hashmap">
|
||||||
|
<![CDATA[
|
||||||
|
UPDATE TB_FILE SET
|
||||||
|
DEL_GB='N'
|
||||||
|
WHERE
|
||||||
|
IDX=#{FILE_IDX}
|
||||||
|
]]>
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<!-- <![CDATA...요건 혹시모를 쿼리문에 <,> 등의 기호가 들어갈때를 대비하여 씀 -->
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<application generated-by="eclipse" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_1.xsd">
|
||||||
|
|
||||||
|
<classpath>
|
||||||
|
<dir name="C:/dev/workspace/first/target/classes"/>
|
||||||
|
<dir name="C:/dev/workspace/first/src/main/resources"/>
|
||||||
|
</classpath>
|
||||||
|
|
||||||
|
<web>
|
||||||
|
<link target="/">
|
||||||
|
<dir name="C:/dev/workspace/first/target/m2e-wtp/web-resources">
|
||||||
|
<exclude name="/"/>
|
||||||
|
</dir>
|
||||||
|
</link>
|
||||||
|
<link target="/">
|
||||||
|
<dir name="C:/dev/workspace/first/src/main/webapp">
|
||||||
|
</dir>
|
||||||
|
</link>
|
||||||
|
</web>
|
||||||
|
|
||||||
|
</application>
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,43 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<beans xmlns:context="http://www.springframework.org/schema/context"
|
||||||
|
xmlns:p="http://www.springframework.org/schema/p"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://www.springframework.org/schema/beans"
|
||||||
|
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||||
|
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.xsd
|
||||||
|
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
|
||||||
|
|
||||||
|
<context:component-scan base-package="first" use-default-filters="false"> <!-- 자동 어노테이션 등록 -->
|
||||||
|
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
|
||||||
|
</context:component-scan>
|
||||||
|
|
||||||
|
<mvc:annotation-driven>
|
||||||
|
<mvc:argument-resolvers>
|
||||||
|
<bean class="first.common.resolver.CustomMapArgumentResolver"></bean>
|
||||||
|
</mvc:argument-resolvers>
|
||||||
|
</mvc:annotation-driven>
|
||||||
|
|
||||||
|
<mvc:interceptors>
|
||||||
|
<mvc:interceptor>
|
||||||
|
<mvc:mapping path="/**"/>
|
||||||
|
<bean id="loggerInterceptor" class="first.common.logger.LoggerInterceptor"></bean>
|
||||||
|
</mvc:interceptor>
|
||||||
|
</mvc:interceptors>
|
||||||
|
|
||||||
|
<aop:aspectj-autoproxy/>
|
||||||
|
<bean id="loggerAspect" class="first.common.logger.LoggerAspect"/>
|
||||||
|
|
||||||
|
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
|
||||||
|
|
||||||
|
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver" p:order="0" />
|
||||||
|
<bean id="jsonView" class="org.springframework.web.servlet.view.json.MappingJackson2JsonView" />
|
||||||
|
|
||||||
|
<bean
|
||||||
|
class="org.springframework.web.servlet.view.UrlBasedViewResolver" p:order="1"
|
||||||
|
p:viewClass="org.springframework.web.servlet.view.JstlView"
|
||||||
|
p:prefix="/WEB-INF/jsp/" p:suffix=".jsp">
|
||||||
|
</bean>
|
||||||
|
</beans>
|
||||||
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
<%@ page pageEncoding="UTF-8"%>
|
||||||
|
<form id="commonForm" name="commonForm"></form>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<%@ page pageEncoding="UTF-8"%>
|
||||||
|
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
|
||||||
|
<title>bloggers</title>
|
||||||
|
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
|
<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %>
|
||||||
|
|
||||||
|
<link rel="stylesheet" type="text/css" href="<c:url value='/css/ui.css'/>" />
|
||||||
|
|
||||||
|
<!-- jQuery -->
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
|
||||||
|
<script src="<c:url value='/js/common.js'/>" charset="UTF-8"></script>
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
|
||||||
|
pageEncoding="EUC-KR"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
|
<%@ include file ="/WEB-INF/include/include-header.jspf" %>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>게시판 목록</h2>
|
||||||
|
<table class="board_list">
|
||||||
|
<colgroup>
|
||||||
|
<col width="10%"/>
|
||||||
|
<col width="50"/>
|
||||||
|
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">글번호</th>
|
||||||
|
<th scope="col">제목</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${fn:length(list) > 0}"> <!-- boolean -->
|
||||||
|
<c:forEach items="${list }" var="row" varStatus="status">
|
||||||
|
<tr>
|
||||||
|
<td>${row.IDX }</td>
|
||||||
|
<td class="title">
|
||||||
|
<a href="#this" name="title">${row.TITLE }</a>
|
||||||
|
<input type="hidden" id="IDX" value="${row.IDX }">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4">조회된 결과가 없습니다.</td>
|
||||||
|
</tr>
|
||||||
|
</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<c:if test="${not empty paginationInfo }">
|
||||||
|
<ui:pagination paginationInfo = "${paginationInfo }" type="text" jsFunction="fn_search"/>
|
||||||
|
</c:if>
|
||||||
|
<input type="hidden" id="currentPageNo" name="currentPageNo"/>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<a href="#this" class="btn" id="write">글쓰기</a>
|
||||||
|
|
||||||
|
<%@ include file="/WEB-INF/include/include-body.jspf" %>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("#write").on("click", function(e){ //글쓰기 버튼
|
||||||
|
e.preventDefault();
|
||||||
|
fn_openBoardWrite();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("a[name='title']").on("click", function(e){ //제목
|
||||||
|
e.preventDefault();
|
||||||
|
fn_openBoardDetail($(this)); //$(this)의미 : jQuery <a 태그의미
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function fn_openBoardWrite(){
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardWrite.do' />");
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_openBoardDetail(obj){
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardDetail.do' />");
|
||||||
|
comSubmit.addParam("IDX", obj.parent().find("#IDX").val()); // key와 value값
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_search(pageNo)
|
||||||
|
{
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardList.do'/>");
|
||||||
|
comSubmit.addParam("currentPageNo", pageNo);
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
|
||||||
|
pageEncoding="EUC-KR"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
|
||||||
|
<script src="http://ajax.googleapis.com/ajax/libs/1/jquery.min.js"></script>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
var name = $('#name');
|
||||||
|
var greeting = $('#greeting');
|
||||||
|
|
||||||
|
name.bind('keydown', function(){
|
||||||
|
setTimeout(greeting.text('HELLO,' + name.val() + '!!!'),0);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<title>Insert title here</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<input id="name" value=""/>
|
||||||
|
<p id="greeting"></p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
<%@ include file="/WEB-INF/include/include-header.jspf" %>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<table class="board_view">
|
||||||
|
<colgroup>
|
||||||
|
<col width="15%"/>
|
||||||
|
<col width="35%"/>
|
||||||
|
<col width="15%"/>
|
||||||
|
<col width="35%"/>
|
||||||
|
</colgroup>
|
||||||
|
<caption>게시글 상세</caption>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">글 번호</th>
|
||||||
|
<td>${map.IDX }</td>
|
||||||
|
<th scope="row">조회수</th>
|
||||||
|
<td>${map.HIT_CNT }</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">작성자</th>
|
||||||
|
<td>${map.CREA_ID }</td>
|
||||||
|
<th scope="row">작성시간</th>
|
||||||
|
<td>${map.CREA_DTM }</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">제목</th>
|
||||||
|
<td colspan="3">${map.TITLE }</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4">${map.CONTENTS }</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">첨부파일</th>
|
||||||
|
<td colspan="3">
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${fn:length(list) >0 }"> <!-- boolean -->
|
||||||
|
<c:forEach var="row" items="${list}">
|
||||||
|
<input type="hidden" id="IDX" value="${row.IDX }">
|
||||||
|
<a href="#this" name="file">${row.ORIGINAL_FILE_NAME }</a>
|
||||||
|
(${row.FILE_SIZE }kb)
|
||||||
|
</c:forEach>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>첨부된 파일이 없습니다.!</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<a href="#this" class="btn" id="list">목록으로</a>
|
||||||
|
<a href="#this" class="btn" id="update">수정하기</a>
|
||||||
|
|
||||||
|
<%@ include file="/WEB-INF/include/include-body.jspf" %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("#list").on("click", function(e){ //목록으로 버튼
|
||||||
|
e.preventDefault();
|
||||||
|
fn_openBoardList();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#update").on("click", function(e){ //수정하기 버튼
|
||||||
|
e.preventDefault();
|
||||||
|
fn_openBoardUpdate();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("a[name='file']").on("click", function(e){ //파일이름
|
||||||
|
e.preventDefault();
|
||||||
|
fn_downloadFile($(this));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function fn_openBoardList(){
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardList.do' />");
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_openBoardUpdate(){
|
||||||
|
var idx = "${map.IDX}";
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardUpdate.do' />");
|
||||||
|
comSubmit.addParam("IDX", idx);
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_downloadFile(obj)
|
||||||
|
{
|
||||||
|
var idx = obj.parent().find("#IDX").val();
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/common/downloadFile.do'/>");
|
||||||
|
comSubmit.addParam("IDX", idx);
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,100 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||||
|
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
|
||||||
|
<%@ include file ="/WEB-INF/include/include-header.jspf" %>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h2>게시판 목록</h2>
|
||||||
|
<table class="board_list">
|
||||||
|
<colgroup>
|
||||||
|
<col width="10%"/>
|
||||||
|
<col width="*"/>
|
||||||
|
<col width="15%"/>
|
||||||
|
<col width="20%"/>
|
||||||
|
</colgroup>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">글번호</th>
|
||||||
|
<th scope="col">제목</th>
|
||||||
|
<th scope="col">조회수</th>
|
||||||
|
<th scope="col">작성일</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${fn:length(list) > 0}"> <!-- boolean -->
|
||||||
|
<c:forEach items="${list }" var="row" varStatus="status">
|
||||||
|
<tr>
|
||||||
|
<td>${row.IDX }</td>
|
||||||
|
<td class="title">
|
||||||
|
<a href="#this" name="title">${row.TITLE }</a>
|
||||||
|
<input type="hidden" id="IDX" value="${row.IDX }">
|
||||||
|
</td>
|
||||||
|
<td>${row.HIT_CNT }</td>
|
||||||
|
<td>${row.CREA_DTM }</td>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4">조회된 결과가 없습니다.</td>
|
||||||
|
</tr>
|
||||||
|
</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<c:if test="${not empty paginationInfo }">
|
||||||
|
<ui:pagination paginationInfo = "${paginationInfo }" type="text" jsFunction="fn_search"/>
|
||||||
|
</c:if>
|
||||||
|
<input type="hidden" id="currentPageNo" name="currentPageNo"/>
|
||||||
|
|
||||||
|
<br/>
|
||||||
|
<a href="#this" class="btn" id="write">글쓰기</a>
|
||||||
|
|
||||||
|
<%@ include file="/WEB-INF/include/include-body.jspf" %>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("#write").on("click", function(e){ //글쓰기 버튼
|
||||||
|
e.preventDefault();
|
||||||
|
fn_openBoardWrite();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("a[name='title']").on("click", function(e){ //제목
|
||||||
|
e.preventDefault();
|
||||||
|
fn_openBoardDetail($(this)); //$(this)의미 : jQuery <a 태그의미
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
function fn_openBoardWrite(){
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardWrite.do' />");
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_openBoardDetail(obj){
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardDetail.do' />");
|
||||||
|
comSubmit.addParam("IDX", obj.parent().find("#IDX").val()); // key와 value값
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_search(pageNo)
|
||||||
|
{
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardList.do'/>");
|
||||||
|
comSubmit.addParam("currentPageNo", pageNo);
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Insert title here</title>
|
||||||
|
<%@ include file="/WEB-INF/include/include-header.jspf" %>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
HI~
|
||||||
|
<%@ include file="/WEB-INF/include/include-body.jspf" %>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
<%@ include file="/WEB-INF/include/include-header.jspf" %>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="frm" name="frm" enctype="multipart/form-data">
|
||||||
|
<table class="board_view">
|
||||||
|
<colgroup>
|
||||||
|
<col width="15%"/>
|
||||||
|
<col width="35%"/>
|
||||||
|
<col width="15%"/>
|
||||||
|
<col width="35%"/>
|
||||||
|
</colgroup>
|
||||||
|
<caption>게시글 상세</caption>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">글 번호</th>
|
||||||
|
<td>
|
||||||
|
${map.IDX }
|
||||||
|
<input type="hidden" id="IDX" name="IDX" value="${map.IDX }">
|
||||||
|
</td>
|
||||||
|
<th scope="row">조회수</th>
|
||||||
|
<td>${map.HIT_CNT }</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">작성자</th>
|
||||||
|
<td>${map.CREA_ID }</td>
|
||||||
|
<th scope="row">작성시간</th>
|
||||||
|
<td>${map.CREA_DTM }</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">제목</th>
|
||||||
|
<td colspan="3">
|
||||||
|
<input type="text" id="TITLE" name="TITLE" class="wdp_90" value="${map.TITLE }">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" class="view_text">
|
||||||
|
<textarea rows="20" cols="100" title="내용" id="CONTENTS" name="CONTENTS">${map.CONTENTS }</textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">첨부파일</th>
|
||||||
|
<td colspan="3">
|
||||||
|
<div id="fileDiv">
|
||||||
|
<c:choose>
|
||||||
|
<c:when test="${fn:length(list)>0 }">
|
||||||
|
<c:forEach var="row" items="${list }" varStatus="var">
|
||||||
|
<p>
|
||||||
|
<input type="hidden" id="IDX" name="IDX_${var.index }" value="${row.IDX }">
|
||||||
|
<a href="#this" id="name_${var.index }" name="name_${var.index }">${row.ORIGINAL_FILE_NAME }</a>
|
||||||
|
<input type="file" id="file_${var.index }" name="file_${var.index }">
|
||||||
|
(${row.FILE_SIZE }kb)
|
||||||
|
<a href="#this" class="btn" id="delete_${var.index }" name="delete_${var.index }">삭제</a>
|
||||||
|
</p>
|
||||||
|
</c:forEach>
|
||||||
|
</c:when>
|
||||||
|
<c:otherwise>첨부된 파일이 없습니다!</c:otherwise>
|
||||||
|
</c:choose>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
<a href="#this" class="btn" id="addFile">파일추가</a>
|
||||||
|
<a href="#this" class="btn" id="list">목록으로</a>
|
||||||
|
<a href="#this" class="btn" id="update">저장하기</a>
|
||||||
|
<a href="#this" class="btn" id="delete">삭제하기</a>
|
||||||
|
|
||||||
|
<%@ include file="/WEB-INF/include/include-body.jspf" %>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
var gfv_count = "${fn:length(list)+1}";
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
$("#list").on("click",function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
fn_openBoardList();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#update").on("click",function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
fn_updateBoard();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#delete").on("click",function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
fn_deleteBoard();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#addFile").on("click", function(e){ //파일 추가
|
||||||
|
e.preventDefault();
|
||||||
|
fn_addFile();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("a[name^='delete']").on("click", function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
fn_deleteFile($(this));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function fn_openBoardList()
|
||||||
|
{
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardList.do'/>");
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_updateBoard()
|
||||||
|
{
|
||||||
|
var comSubmit = new ComSubmit("frm");
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/updateBoard.do'/>");
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_deleteBoard()
|
||||||
|
{
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/deleteBoard.do'/>");
|
||||||
|
comSubmit.addParam("IDX",$("#IDX").val());
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_addFile()
|
||||||
|
{
|
||||||
|
var str = "<p><input type='file' id='file_"+(gfv_count)+"' name='file_"+(gfv_count)+"'>"+
|
||||||
|
"<a href='#this' class='btn' id='delete_"+(gfv_count)+"' name='delete_"+(gfv_count)+"'>삭제</a></p>";
|
||||||
|
|
||||||
|
$("#fileDiv").append(str);
|
||||||
|
$("#delete_"+(gfv_count++)).on("click", function(e){
|
||||||
|
e.preventDefault();
|
||||||
|
fn_deleteFile($(this));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//boardWrite.jsp 와 비교
|
||||||
|
|
||||||
|
/* function fn_addFile(){
|
||||||
|
var str = "<p><input type='file' name='file_"+(gfv_count++)+"'><a href='#this' class='btn' name='delete'>삭제</a></p>";
|
||||||
|
$("#fileDiv").append(str);
|
||||||
|
$("a[name='delete']").on("click", function(e){ //삭제 버튼
|
||||||
|
e.preventDefault();
|
||||||
|
fn_deleteFile($(this));
|
||||||
|
});
|
||||||
|
} */
|
||||||
|
|
||||||
|
|
||||||
|
function fn_deleteFile(obj)
|
||||||
|
{
|
||||||
|
obj.parent().remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,97 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||||
|
pageEncoding="UTF-8"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html lang="ko">
|
||||||
|
<head>
|
||||||
|
<%@ include file="/WEB-INF/include/include-header.jspf" %>
|
||||||
|
<title>Insert title here</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<form id="frm" name="frm" enctype="multipart/form-data">
|
||||||
|
<table class="board_view">
|
||||||
|
<colgroup>
|
||||||
|
<col width="15%">
|
||||||
|
<col width="*"/>
|
||||||
|
</colgroup>
|
||||||
|
<caption>게시글 작성</caption>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">제목</th>
|
||||||
|
<td><input type="text" id="TITLE" name="TITLE" class="wdp_90"></input></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" class="view_text">
|
||||||
|
<textarea rows="20" cols="80" title="내용" id="CONTENTS" name="CONTENTS"></textarea>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<!-- <input type="file" name="file"><br/><br/> -->
|
||||||
|
|
||||||
|
<div id="fileDiv">
|
||||||
|
<p>
|
||||||
|
<input type="file" id="file" name="file_0">
|
||||||
|
<a href="#this" class="btn" id="delete" name="delete">삭제</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<br/><br/>
|
||||||
|
<a href="#this" class="btn" id="addFile">파일추가</a>
|
||||||
|
<a href="#this" class="btn" id="write">작성하기</a>
|
||||||
|
<a href="#this" class="btn" id="list">목록으로</a>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<%@ include file="/WEB-INF/include/include-body.jspf" %>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var gfv_count = 1;
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
$("#list").on("click", function(e){ //목록으로 버튼
|
||||||
|
e.preventDefault();
|
||||||
|
fn_openBoardList();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#write").on("click", function(e){ //작성하기 버튼
|
||||||
|
e.preventDefault();
|
||||||
|
fn_insertBoard();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#addFile").on("click", function(e){ //파일추가하기
|
||||||
|
e.preventDefault();
|
||||||
|
fn_addFile();
|
||||||
|
});
|
||||||
|
|
||||||
|
$("a[name='delete']").on("click", function(e){ //추가한 파일 삭제하기
|
||||||
|
e.prevnetDefault();
|
||||||
|
fn_deleteFile($(this));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
function fn_openBoardList(){
|
||||||
|
var comSubmit = new ComSubmit();
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/openBoardList.do' />");
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_insertBoard(){
|
||||||
|
var comSubmit = new ComSubmit("frm");
|
||||||
|
comSubmit.setUrl("<c:url value='/sample/insertBoard.do' />");
|
||||||
|
comSubmit.submit();
|
||||||
|
}
|
||||||
|
|
||||||
|
function fn_addFile(){
|
||||||
|
var str = "<p><input type='file' name='file_"+(gfv_count++)+"'><a href='#this' class='btn' name='delete'>삭제</a></p>";
|
||||||
|
$("#fileDiv").append(str);
|
||||||
|
$("a[name='delete']").on("click", function(e){ //삭제 버튼
|
||||||
|
e.preventDefault();
|
||||||
|
fn_deleteFile($(this));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function fn_deleteFile(obj)
|
||||||
|
{
|
||||||
|
obj.parent().remove(); //<p>태그 삭제
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
|
||||||
|
pageEncoding="EUC-KR"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
kkkk
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
|
||||||
|
<%@ page session="false" %>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Home</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>
|
||||||
|
Hello world!
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<P> The time on the server is ${serverTime}. </P>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
|
||||||
|
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">
|
||||||
|
|
||||||
|
<welcome-file-list>
|
||||||
|
<welcome-file>index.jsp</welcome-file>
|
||||||
|
</welcome-file-list>
|
||||||
|
|
||||||
|
<filter>
|
||||||
|
<filter-name>encodingFilter</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>encodingFilter</filter-name>
|
||||||
|
<url-pattern>*.do</url-pattern>
|
||||||
|
</filter-mapping>
|
||||||
|
|
||||||
|
<listener>
|
||||||
|
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||||
|
</listener>
|
||||||
|
|
||||||
|
<servlet>
|
||||||
|
<servlet-name>action</servlet-name>
|
||||||
|
<servlet-class>
|
||||||
|
org.springframework.web.servlet.DispatcherServlet
|
||||||
|
</servlet-class>
|
||||||
|
<init-param>
|
||||||
|
<param-name>contextConfigLocation</param-name>
|
||||||
|
<param-value>
|
||||||
|
/WEB-INF/config/*-servlet.xml
|
||||||
|
</param-value>
|
||||||
|
</init-param>
|
||||||
|
<load-on-startup>1</load-on-startup>
|
||||||
|
</servlet>
|
||||||
|
<servlet-mapping>
|
||||||
|
<servlet-name>action</servlet-name>
|
||||||
|
<url-pattern>*.do</url-pattern>
|
||||||
|
</servlet-mapping>
|
||||||
|
|
||||||
|
<!-- 스프링 설정 파일 읽어 들이기~ㅋ -->
|
||||||
|
<context-param>
|
||||||
|
<param-name>contextConfigLocation</param-name>
|
||||||
|
<param-value>classpath*:config/spring/context-*.xml</param-value>
|
||||||
|
</context-param>
|
||||||
|
</web-app>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
@CHARSET "UTF-8";
|
||||||
|
|
||||||
|
a:link, a:visited {text-decoration: none; color: #656565;}
|
||||||
|
|
||||||
|
.board_list {width:100%;border-top:2px solid #252525;border-bottom:1px solid #ccc}
|
||||||
|
.board_list thead th:first-child{background-image:none}
|
||||||
|
.board_list thead th {border-bottom:1px solid #ccc;padding:12px 0 13px 0;color:#3b3a3a;vertical-align:middle}
|
||||||
|
.board_list tbody td {border-top:1px solid #ccc;padding:10px 0;text-align:center;vertical-align:middle}
|
||||||
|
.board_list tbody tr:first-child td {border:none}
|
||||||
|
.board_list tbody td.title {text-align:left; padding-left:20px}
|
||||||
|
.board_list tbody td a {display:inline-block}
|
||||||
|
|
||||||
|
.board_view {width:30%;border-top:2px solid #252525;border-bottom:1px solid #ccc}
|
||||||
|
.board_view tbody th {text-align:left;background:#f7f7f7;color:#3b3a3a}
|
||||||
|
.board_view tbody th.list_tit {font-size:13px;color:#000;letter-spacing:0.1px}
|
||||||
|
.board_view tbody .no_line_b th, .board_view tbody .no_line_b td {border-bottom:none}
|
||||||
|
.board_view tbody th, .board_view tbody td {padding:15px 0 16px 16px;border-bottom:1px solid #ccc}
|
||||||
|
.board_view tbody td.view_text {border-top:1px solid #ccc; border-bottom:1px solid #ccc;padding:45px 18px 45px 18px}
|
||||||
|
.board_view tbody th.th_file {padding:0 0 0 15px; vertical-align:middle}
|
||||||
|
|
||||||
|
.wdp_90 {width:60%}
|
||||||
|
.btn {border-radius:3px;padding:5px 11px;color:#fff !important; display:inline-block; background-color:#6b9ab8; border:1px solid #56819d;vertical-align:middle}
|
||||||
|
.pad_5 {padding: 5px}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<%@ page language="java" contentType="text/html; charset=EUC-KR"
|
||||||
|
pageEncoding="EUC-KR"%>
|
||||||
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
|
||||||
|
<title>Insert title here</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<jsp:forward page="/sample/openSampleList.do"/>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Binary file not shown.
@@ -0,0 +1,179 @@
|
|||||||
|
function gfn_isNull(str) {
|
||||||
|
if (str == null) return true;
|
||||||
|
if (str == "NaN") return true;
|
||||||
|
if (new String(str).valueOf() == "undefined") return true;
|
||||||
|
var chkStr = new String(str);
|
||||||
|
if( chkStr.valueOf() == "undefined" ) return true;
|
||||||
|
if (chkStr == null) return true;
|
||||||
|
if (chkStr.toString().length == 0 ) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 공통 서브밋 객체 (Target/Popup 대응 버전)
|
||||||
|
*/
|
||||||
|
function ComSubmit(opt_formId) {
|
||||||
|
this.formId = (typeof opt_formId === "undefined" || opt_formId === null || opt_formId === "") ? "commonForm" : opt_formId;
|
||||||
|
this.url = "";
|
||||||
|
this.target = "_self"; // 기본값은 현재 창
|
||||||
|
|
||||||
|
var $targetForm = $("#" + this.formId);
|
||||||
|
|
||||||
|
// [1] 초기화: commonForm일 경우 내부를 비우고 target도 기본값으로 리셋
|
||||||
|
if ($targetForm.length > 0 && this.formId === "commonForm") {
|
||||||
|
$targetForm.empty();
|
||||||
|
$targetForm.attr("target", "_self"); // 이전 타겟 설정 제거
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setUrl = function setUrl(url) {
|
||||||
|
this.url = url;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [2] 타겟 설정 (팝업창 이름이나 _blank 등)
|
||||||
|
*/
|
||||||
|
this.setTarget = function setTarget(target) {
|
||||||
|
this.target = target;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.addParam = function addParam(key, value) {
|
||||||
|
if ($targetForm.length === 0) return;
|
||||||
|
var $existingParam = $targetForm.find("input[name='" + key + "']");
|
||||||
|
|
||||||
|
if ($existingParam.length > 0) {
|
||||||
|
$existingParam.val(value);
|
||||||
|
} else {
|
||||||
|
var inputHtml = $("<input>", { type: "hidden", name: key, id: key, value: value });
|
||||||
|
$targetForm.append(inputHtml);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [3] 서버 전송
|
||||||
|
*/
|
||||||
|
this.submit = function submit() {
|
||||||
|
if ($targetForm.length === 0) return;
|
||||||
|
|
||||||
|
var frm = $targetForm[0];
|
||||||
|
if (!this.url) {
|
||||||
|
alert("전송할 URL이 설정되지 않았습니다.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
frm.action = this.url;
|
||||||
|
frm.method = "post";
|
||||||
|
frm.target = this.target; // 설정된 타겟 적용
|
||||||
|
frm.submit();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
var gfv_ajaxCallback = "";
|
||||||
|
|
||||||
|
function ComAjax(opt_formId)
|
||||||
|
{
|
||||||
|
this.url = "";
|
||||||
|
this.formId = gfn_isNull(opt_formId) == true?"commonForm":opt_formId;
|
||||||
|
this.param = "";
|
||||||
|
|
||||||
|
if(this.formId == "commonForm")
|
||||||
|
{
|
||||||
|
var frm = $("#commonForm");
|
||||||
|
if(frm.length>0){
|
||||||
|
frm.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
var str = "<form id='commonForm' name='commonForm'></form>";
|
||||||
|
$('body').append(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setUrl = function setUrl(url)
|
||||||
|
{
|
||||||
|
this.url = url;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.setCallback = function setCallback(callBack)
|
||||||
|
{
|
||||||
|
fv_ajaxCallback = callBack;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.addParam = function addParam(key, value)
|
||||||
|
{
|
||||||
|
this.param = this.param + "&" + key + "=" + value;
|
||||||
|
};
|
||||||
|
|
||||||
|
this.ajax = function ajax()
|
||||||
|
{
|
||||||
|
if(this.formId != "commonForm"){
|
||||||
|
this.param += "&" + $("#" + this.formId).serialize();
|
||||||
|
}
|
||||||
|
$.ajax({
|
||||||
|
url : this.url,
|
||||||
|
type : "post",
|
||||||
|
data : this.param,
|
||||||
|
async : false,
|
||||||
|
success : function(data, status){
|
||||||
|
if(typeof(fv_ajaxCallback) == "function"){
|
||||||
|
fv_ajaxCallback(data);
|
||||||
|
}else{
|
||||||
|
eval(fv_ajaxCallback + "(data);");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
//페이징 태그부분
|
||||||
|
/*
|
||||||
|
* divId : 페이징 태그가 그려질 div
|
||||||
|
* pageIndx : 현재 페이지 위치가 저장될 input 태그 id
|
||||||
|
* recordCount : 페이지당 레코드 수
|
||||||
|
* totalCount : 전체 조회 건수
|
||||||
|
* eventName : 페이징 하단의 숫자 등의 버튼이 클릭되었을때 호출될 함수 이름
|
||||||
|
*/
|
||||||
|
|
||||||
|
var gfv_pageIndex = null;
|
||||||
|
var gfv_eventName = null;
|
||||||
|
|
||||||
|
function gfn_renderPaging(params)
|
||||||
|
{
|
||||||
|
var divId = params.divId; //페이징이 그려질 div id
|
||||||
|
gfv_pageIndex = params.pageIndex; //현재 위치가 저장될 input 태그
|
||||||
|
var totalCount = params.totalCount; //전체 조회 건수
|
||||||
|
var currentIndex = $("#"+params.pageIndex).val(); //현재 위치
|
||||||
|
if($("#"+params.pageIndex).length == 0 || gfn_isNull(currentIndex) == true){
|
||||||
|
currentIndex = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
var recordCount = params.recordCount; //페이지당 레코드 수
|
||||||
|
if(gfn_isNull(recordCount) == true){
|
||||||
|
recordCount = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
var totalIndexCount = Math.ceil(totalCount/recordCount); //전체 인덱스 수
|
||||||
|
gfn_eventName = params.eventName;
|
||||||
|
/*
|
||||||
|
* Math.floor : 소수점 버림
|
||||||
|
* Math.ceil : 소수점 올림
|
||||||
|
* Math.round : 반올림
|
||||||
|
* Math.random : 랜덤함수
|
||||||
|
* Math.sqrt : 제곱근
|
||||||
|
* Math.pow : 제곱
|
||||||
|
* Math.abs : 절대값
|
||||||
|
*/
|
||||||
|
|
||||||
|
$("#"+divId).empty();
|
||||||
|
var preStr = "";
|
||||||
|
var postStr = "";
|
||||||
|
var str = "";
|
||||||
|
|
||||||
|
var first = (parseInt((currentIndex-1)/10)*10) + 1;
|
||||||
|
var last = (parseInt(totalCount/10)==parseInt(currentIndex/10))?totalIndexCount%10:10;
|
||||||
|
var prev = (parseInt((currentIndex-1)/10)*10) - 9 > 0 ? (parseInt((currentIndex-1)/10)*10) - 9 : 1;
|
||||||
|
var next = (parseInt((currentIndex-1)/10)+1) * 10 + 1 < totalIndexCount ? (parseInt((currentIndex-1)/10)+1) * 10 + 1 : totalIndexCount;
|
||||||
|
|
||||||
|
if(totalIndexCount>10){
|
||||||
|
preStr += "<a href='#this' class='pad_5' onclick='_movePage(1)'>[<<]</a>"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user