기본 콘텐츠로 건너뛰기

1월, 2014의 게시물 표시

Spring 로컬 마음데로 변경하기

Interceptor.java public class Interceptors extends HandlerInterceptorAdapter { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { //메소드는 컨트롤러가 호출되기 전에 실행된다. Locale locale = extractLocale(request, "ko" ); LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request); localeResolver.setLocale(request, response, locale); return true ; } private Locale extractLocale(HttpServletRequest request,String local) { if (StringUtils.hasText(local)) { return StringUtils.parseLocaleString(local); } return request.getLocale(); } } web-interceptor.xml <? xml version = "1.0" encoding = "UTF-8" ?> < beans   xmlns = "http://www.springframework.org/schema/beans" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"   xmlns:context = "ht

Vert.x 목표

1. 파일 업로드 구현 (정말 간단하였다. uploadHandler,streamToFileSystem의 메소드만 사용하면 되지만 용량이 큰 파일일 경우 끊긴다. 이 메소드를 사용하여 다른 방법으로 해야할 듯 하다.) 2. 대용량 파일 업로드 구현 3. 클라이언트마다 각각의 가상서버를 부여하여 여러 유저 사용가능하도록 구현 4. 이쁘게 화면 꾸미기 5. 기존 개발했던 프로젝트 Spring과 연동 6. 배포

Vert.x 설치

필자가 사용하는 OS는 매킨토시이다. 그러기에 매킨토시 기준으로 글을 작성하겠다. http://vertx.io/downloads.html  링크된 사이트에 가서 원하는 버전을 다운받는다. 이제 환경변수를 추가해야한다 터미널에서 $ ls -a 명령어를 쓰면 $ .bash_profile 이라는게 보일것이다 여기에 환경변수를 작성한다. 예시 ( export PATH=${PATH}:/Users/kwangheum/springsource/vert.x-1.3.1.final/bin ) 그다음 변경된 환경변수를 사용하려면 $ source .bash_profile 명령어를 사용하면 설치는 끝난것이다. Vert.x 설치된것을 확인하기 위해서는 $ vertx version이라고 치면 나온다.