키패드 기능은 InputMethodManager객체를 이용해서 다룰 수 있다. EditText에 포커스를 하면 자동으로 키패드가 뜨는데 inputType이라는 속성 값을 부여함으로써 다른 모드의 키패드를 불러 올 수있다. 다음은 inputType의 대표적 속성이다.inputType 속성값 설 명 number 숫자 numberSigned 0보다 큰 숫자 numberDecimal 정수 text 일반 텍스트 textPassword 패스워드 표시 textEmalAddress 이메일 표시 phone 전화번호 표시 time 시간 date 날짜 layout.xml12345678910111213141516171819202122232425262728293031 Colored by Color Scriptercs activ..
+메이븐 설정1234567891011121314151617 org.springframework spring-websocket ${org.springframework-version} org.springframework spring-messaging ${org.springframework-version} com.fasterxml.jackson.core jackson-databind 2.2.3Colored by Color Scriptercs +웹소켓 요청에 대한 핸들러 작성12345678910111213141516171819202122232425262728293031323334353637383940414243@Componentpublic class ContentHandler extends TextWebSock..
@MVC는 애노테이션 기반의 컨트롤러 기술이다.@MVC 이전의 컨트롤러는 타입을 비교해서 컨트롤러를 선택하고, 그 타입의 구현된 메서드를 호출하는 방법을 사용했다면, @MVC는 @RequestMapping을 이용해서 컨트롤러 클래스나 메서드를 선택하여 호출하는 방법을 사용한다. 이것을 사용하기 위해서는 DefaultAnnotationHandlerMapping을 사용해야 했지만 스프링 3.2부터 deprecated되었고, RequestMappingHandlerMapping가 대신한다. RequestMappingHandlerMapping는 기본적으로 등록되는 빈이라 등록해줄 필요가 없지만 만약 다른 핸들러 매핑 빈을 사용하고 있다면 수동으로 서블릿 컨테이너에 이 빈을 등록해줘야 사용할 수 있다. @Reque..
컨트롤러 스프링에서는 컨트롤러의 유연한 개발을 위해 컨트롤러가 될 수 있는 대상에 대해 제한을 두고 있지 않는다. 스프링은 사용자의 모든 요청이 DispatcherServlet(web.xml에 서블릿으로 정의되어 있음)을 거친다. 직접 컨트롤러 클래스를 작성하기 위해서는 스프링 MVC가 지원하는 컨트롤러를 구현해야 하고 DispatcherServlet에 연결해주는 컨트롤러 어댑터가 필요하다. Servlet, SimpleServletHandlerAdapter이 컨트롤러와 컨트롤러 어댑터는 기존 표준 서블릿(HttpSErvlet을 상속받아 정의하는 서블릿) 클래스 코드를 그대로 유지하면서 사용할 수 있도록한다. HttpRequestHandler, HttpRequestHandlerAdapter이 컨트롤러와 어..
초기화 메서드는 빈 객체가 생성되고 의존관계 주입이 끝난 시점에 실행되는 메서드를 말한다. 생성자에서 초기화 작업을 해도 되지만 빈에서 주입받는 모든 의존관계 변수나 프로퍼티의 DI 작업이 끝난 시점 이후에 초기화를 해야 될 때 초기화 메서드를 사용한다. 초기화 메서드를 지정하는 방법 init-method속성을 xml에 빈 선언시에 지정@PostConstruct init-method속성을 xml 빈 선언시 지정1cs빈 정의시에 init-method 속성에 DI작업이 끝난 이후에 호출될 메서드를 선언해준다. 123456789101112131415161718@Controllerpublic class TestTwoController { CarInfoProvider car; @Resource(name="kiaC..