1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>
 
int main(void) {
    int i,sc;
 
    scanf("%d"&sc); // 반복할 횟수 입력
    if(sc <= 10) { // 문제 조건에 10번 이하 반복하기
        for(i=1; i<=sc; i++) { // 입력 횟수 만큼 반복한다.
            printf("Hello Algospot!\n");
        }
    }
    return 0;
}
cs


더 간단하게 하는 방법이 있을지 생각해 봐야겠다..


파이썬(python) 사용하기


1. 파이썬을 이용한 계산

파이썬은 계산이 가능합니다.

파이썬 IDLE를 실행하면 Python 3.X.X Shell이 실행됩니다.

여기에 계산하고 싶은 숫자를 입력하게 되면 파이썬은 계산을 해줍니다.



파이썬에서 사용할 수 있는 산술 연산자에 대해 알아보겠습니다.

 연산자

의미 

입력 예제 

 출력값 

 +

더하기 

1+1

2

 -

 빼기

4-1

3

 *

 곱하기

2*3

6

 /

 나누기 (정수값과 소숫점 표시)

3/2

1.5

 //

 나누기 (정수값만 표시)

3//2

1

 %

 나머지

10%3

1



2. Hello, World!

1
print("Hello, World")
cs

파이썬 IDLE를 실행한 후에 위에 있는 코드를 작성하게 되면 파이썬은 명령어를 인식하고 아래와 같이

Hello, World를 출력합니다.



3. 문자와 숫자값 결합하기

print 함수로 숫자와 문자를 결합할 수 있습니다.

1
2
3
print("10을 3으로 나누기 :" , 10/3)
print("10을 3으로 나눈 나머지 :"10%3)
print("10을 3으로 나누면"10//3,"이고 나머지는",10%3,"이다")
cs


파이썬에 이렇게 입력하게 되면 아래와 같은 출력값이 나옵니다.


문자열은 큰따옴표(")로 묶어주고 연산할 값은 큰따옴표를 사용하지 않습니다.

문자열과 숫자를 구분해 주기 위해 콤마(,)를 사용합니다.


1. 파이썬(Python) 설치하기

윈도우에서 파이썬(Python)을 설치하는 방법입니다.


먼저 http://www.python.org/ 홈페이지에 접속합니다.

Downloads 메뉴를 클릭하면 파이썬을 다운로드 받을 수 있습니다.



2017년 1월 현재 최신버전은 Python 3.6.0과 2.7.13입니다. 

파이썬의 3.X버전과 2.X 버전의 차이가 크기때문에 두개 모두 사용하고 있습니다.

이 블로그에서는 3버전에 대해 포스팅 할 예정이므로 이 블로그를 참고하실 분은 3버전을 다운받아 주시길 바랍니다.




설치파일을 실행한 상태 입니다. 

Install Now를 클릭해 주시면 아래 사진과 같이 설치를 시작합니다.



설치가 완료되었으면 Close를 눌러 완료합니다. 



2. 파이썬 실행하기

[시작메뉴] - [모든 프로그램]을 눌러보면 Python 3.6이 설치되어 있습니다.


파이썬 실행을 하려면 IDLE (Python 3.6 32bit) 를 클릭하면 됩니다.

이제 파이썬 사용을 위한 준비가 끝났습니다.


1
2
3
4
5
6
7
8
9
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <title>제목을 입력하세요</title>
    </head>
    <body>
    </body>
</html>
cs


'프로그래밍 > HTML' 카테고리의 다른 글

brackets 플러그인  (0) 2016.07.07

Brackets 다운로드

http://brackets.io/

들여쓰기 가이드라인

https://github.com/lkcampbell/brackets-indent-guides


자동 줄맞춤 (ctrl + shift + L )


'프로그래밍 > HTML' 카테고리의 다른 글

html5 기본 예제  (0) 2017.01.08
톰캣 버전 : 8.0
STS 3.8


server -> tomcat 8.0 -> context.xml

1
2
3
4
5
6
7
8
9
10
11
12
<Resource
    name = "jdbc/oracle"
    auth = "Container"
    type = "javax.sql.DataSource"
    driverClassName = "oracle.jdbc.OracleDriver"
    url = "jdbc:oracle:thin:@localhost:xe"
    username = "DB_ID"
    password = "DB_PW"
    maxActive = "50"
    maxIdle = "20"
    maxWait = "-1"
 />
cs


'프로그래밍 > JAVA' 카테고리의 다른 글

JDK 설치 & 환경변수 설정  (0) 2016.05.05

프로젝트 생성 : Spring Legacy Project
프로젝트명 : 03_MyBatis
템플릿 : Spring MVC Project
top-level package : com.mybatis.controller

pom.xml 추가 부분은 굵은 글씨로 표현

repositoriy추가관련 : http://mavenrepository.com/


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<?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.mybatis</groupId>
    <artifactId>controller</artifactId>
    <name>03_MyBatis</name>
    <packaging>war</packaging>
    <version>1.0.0-BUILD-SNAPSHOT</version>
    <properties>
        <java-version>1.8</java-version>
        <org.springframework-version>4.0.0.RELEASE</org.springframework-version>
        <org.aspectj-version>1.6.10</org.aspectj-version>
        <org.slf4j-version>1.6.6</org.slf4j-version>
    </properties>
 
 
    <!-- 사설 저장소 추가 -->
    <repositories>
        <repository>
            <id>codelds</id>
            <url>http://code.lds.org/nexus/content/groups/main-repo</url>
        </repository>
    </repositories>
 
 
    <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>
 
 
        <!-- Oracle JDBC -->
        <dependency>
            <groupId>com.oracle</groupId>
            <artifactId>ojdbc6</artifactId>
            <version>11.2.0.3</version>
        </dependency>
 
        <!-- commons-dbcp -->
        <dependency>
            <groupId>commons-dbcp</groupId>
            <artifactId>commons-dbcp</artifactId>
            <version>1.4</version>
        </dependency>
 
        <!--Spring-JDBC -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
 
        <!-- mybatis -->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>3.2.8</version>
        </dependency>
        <!-- mybatis-spring -->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>1.2.2</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>
 


cs


src/main/webapp/WEB-INF/web.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?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">
 
    <!-- The definition of the Root Spring Container shared by all Servlets 
        and Filters -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/root-context.xml</param-value>
    </context-param>
 
    <!-- Creates the Spring Container shared by all Servlets and Filters -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
 
    <!-- Processes application requests -->
    <servlet>
        <servlet-name>appServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
 
    <servlet-mapping>
        <servlet-name>appServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
 
    <!-- 한글깨짐 방지 -->
    <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>/*</url-pattern>
    </filter-mapping>
 
</web-app>
 
cs




src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
 
    <!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
    
    <!-- Enables the Spring MVC @Controller programming model -->
    <annotation-driven />
 
    <!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
    <resources mapping="/resources/**" location="/resources/" />
 
    <!-- Resolves views selected for rendering by @Controllers to .jsp resources in the /WEB-INF/views directory -->
    <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <beans:property name="prefix" value="/WEB-INF/views/" />
        <beans:property name="suffix" value=".jsp" />
    </beans:bean>
    
    <context:component-scan base-package="com.mybatis.controller" />
    
    <!-- 데이터 소스(DB 접속 정보) -->
    <beans:bean name="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <beans:property name="driverClassName"    value="oracle.jdbc.driver.OracleDriver" />
        <beans:property name="url"                value="jdbc:oracle:thin:@localhost:1521:xe" />
        <beans:property name="username"           value="DATABASE_ID" />
        <beans:property name="password"           value="DATABASE_PASSWORD" />
    </beans:bean>
    
    <!-- 마이바티스 mapper(쿼리 xml) 위치설정 -->
    <beans:bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
        <beans:property name="dataSource" ref="dataSource" />
        <beans:property name="mapperLocations" value="classpath:com/mybatis/dao/*.xml"/>
    </beans:bean>
    
    <!-- sqlsession template 설정 (DB처리 관련기능 처리) -->
    <beans:bean id="mybatisMapper" class="org.mybatis.spring.SqlSessionTemplate">
        <beans:constructor-arg index="0" ref="sqlSessionFactory"/>
    </beans:bean>
    
</beans:beans>
 
cs


'프로그래밍 > Spring' 카테고리의 다른 글

jquery를 이용한 ajax json  (0) 2017.08.28
회원가입  (0) 2017.08.24
STS설정 및 스프링 한글깨짐 방지 설정  (0) 2016.06.13

1. STS(Spring Tool Suite)에서 한글이 깨지는 이유

STS(스프링) 에서 한글이 깨지는 이유는 기본 인코딩이 MS949로 되어 있어서 한글이 깨진다.


인코딩을 모두 UTF-8로 변경을 해주어야 한글이 깨지지 않는다.


2. STS 한글깨짐 방지 설정

먼저 Window - Preferences 로 들어가준다.




CSS, HTML, JSP 항목에서 Encoding 항목을 ISO 10646/Unicode(UTF-8)로 변경해 준다.




General -> Workspace의 Text file encoiding 을 UTF-8로 바꿔준다.




General -> Web Brower에서 New를 누른후 Chrome을 설정한다.




Location은 Chrome이 설치된 위치를 지정한다.


3. 프로젝트 생성




Spring Legacy Project로 새로운 Project를 생성한다.



Project Name을 입력하고, Spring MVC Project를 선택한후 Next를 누른다.


네모칸을 채운후 Finish를 누른다.



처음 프로젝트를 생성하면 빨간색 X표가 뜨는데 자동으로 설치가 된 후에 x표가 사라진다.



src/main/java-com.spring.staff-HomeController.java

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.spring.staff;
 
import java.text.DateFormat;
import java.util.Date;
import java.util.Locale;
 
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
 
@Controller
public class HomeController {
    
    private static final Logger logger = LoggerFactory.getLogger(HomeController.class);
    
    @RequestMapping(value = "/", method = RequestMethod.GET)
    public String home(Locale locale, Model model) {
        logger.info("Welcome home! The client locale is {}.", locale); // 콘솔창에 나오는 영역
        
        Date date = new Date();
        DateFormat dateFormat = DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG, locale);
        
        String formattedDate = dateFormat.format(date);
        
        model.addAttribute("serverTime", formattedDate ); // home.jsp에 serverTime부분을 변경해준다.
        
        return "home";
    }
    
}
cs



src-main-webapp-WEB-INF-views-home.jsp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<%@ 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>
 
cs

새로운 jsp파일을 만들고 <html>영역을 붙여넣는다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<%@ 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>Home</title>
</head>
<body>
<h1>
    Hello world!  
</h1>
 
<P>  The time on the server is ${serverTime}. </P>
</body>
</html>
cs



프로젝트 생성 후에 아래의 경로로 이동하여 한글이 깨지지 않게 인코딩 항목을 추가해 준다.


web.xml에서 한글깨짐 방지 부분을 추가해 준다.

src-main-webapp-WEB-INF-web.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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">
 
    <!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/spring/root-context.xml</param-value>
    </context-param>
    
    <!-- Creates the Spring Container shared by all Servlets and Filters -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
 
    <!-- Processes application requests -->
    <servlet>
        <servlet-name>appServlet</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
        
    <servlet-mapping>
        <servlet-name>appServlet</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
    
    <!-- 한글깨짐 방지 --> 
    <!-- filter와 filter-mapping을 만들어 준다. -->
    <filter> 
        <!-- filter안에는 filter-name, filter-class, init-param을 추가해 준다.
              filter-name은 원하는대로 지정해도됨 -->
        <filter-name>encodingFilter</filter-name> 
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param> 
            <!-- encoidng값을 UTF-8로 만들어 준다. -->
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
 
</web-app>
 
cs



src-main-webapp-WEB-INF-spring-appServlet-servlet-context.xml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
    
    <!-- 컴파일시 참조 역활 /@Controller, @Autowired, @Inject 등을 사용 가능하게 함 -->
    <annotation-driven />
 
    <!-- 좌측에 있는 내용을 우측처럼 축약해서 사용 -->
    <resources mapping="/resources/**" location="/resources/" />
 
    <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <beans:property name="prefix" value="/WEB-INF/views/" />
        <beans:property name="suffix" value=".jsp" />
    </beans:bean>
    
    <context:component-scan base-package="com.spring.controller" />
    
</beans:beans>
cs



4. Tomcat에서 한글깨짐 설정


실행할 프로젝트명에서 마우스 오른쪽 클릭후 Run As - Run on Server를 클릭한다.



Apache Tomcat v8,0 Server를 선택해 준다.


실행할 프로젝트를 오른쪽으로 보낸후 Finish를 클릭한다.



서버가 실행된 후에 아래와같이 설정을 추가해 준다.

URIEncoding="UTF-8" 인코딩 설정을 UTF-8로 해준다.



63
<Connector URIEncoding="UTF-8" connectionTimeout="20000" port="9090" protocol="HTTP/1.1" redirectPort="8443"/>
cs


'프로그래밍 > Spring' 카테고리의 다른 글

jquery를 이용한 ajax json  (0) 2017.08.28
회원가입  (0) 2017.08.24
MyBatis 세팅  (0) 2016.06.15


2016년 5월 5일 기준

최신버전은 jdk-8u91



빨간 네모안에있는 Accept License Agreement 를 체크한 후에 자신의 운영체제와 맞는 버전을 다운 받는다.





'프로그래밍 > JAVA' 카테고리의 다른 글

톰캣 커넥션풀 설정  (0) 2016.07.06

Google jquery CDN

https://developers.google.com/speed/libraries/#jquery


위 사이트에 들어가면 아래와 같은 것이 나온다.




자신이 원하는 버전을 하나 골라 아래와같이 붙여넣기 하면 jQuery를 사용할 수 있다.

아래는 jQuery 3.1.1을 적용한 예제


1
2
3
4
5
6
7
8
9
10
11
12
13
<!DOCTYPE HTML>
<html>
 
<head>
    <meta charset="utf-8">
    <title>제목을 입력하세요</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
</head>
 
<body>
</body>
 
</html>
cs


+ Recent posts