본문 바로가기

전체 글168

Spring framework Page<T> 와 DataTables.js 연동 Spring framework Page 와 DataTables.js 연동 Spring framework Controller 에서 사용할 SearchContext 생성 @Data @Accessors(chain=true) public class SearchContext { private String search; private String keyword; private String order; private Direction direction = Direction.ASC; private int size = 20; private int page = 1; public String getSearchParam() { URIStringBuilder builder = new URIStringBuilder(); buil.. 2020. 2. 1.
Spring @Controller 에서 파라미터로 배열 받기 ajax로 보낼경우 리터럴에 배열을 담아 보내기 때문에 Controller 단에서 처리할때에는 @RequestParam(value="arr[]") String[] arr 이고 그냥 get이나 post로 값을 보내게 될경우는 @RequestParam(value="arr") String[] arr 2020. 2. 1.
[spring-boot-data-rest] How to expose IDs for all spring data rest 사용시 일괄적용으로 @ID 컬럼을 함께 데이터로 내보내고 싶을 때 나는 아래의 코드를 사용한다. Append configuration file to spring-configuration. import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.data.rest.core.config.RepositoryRestConfiguration;import org.springframework.data.rest.webmvc.config.RepositoryRestConfigurer;import org.s.. 2020. 2. 1.
[spring-boot-starter-data-jpa] with java1.6 edit pom.xml 7.0.59 2.6.7 ........ org.jboss.spec.javax.transaction jboss-transaction-api_1.2_spec 1.0.0.Final org.springframework.boot spring-boot-starter-data-jpa javax.transaction javax.transaction-api .......... 2020. 2. 1.
Spring + StompWebsocket Maven dependences org.springframework.boot spring-boot-starter-websocket org.webjars sockjs-client 1.1.2 org.webjars stomp-websocket 2.3.3-1 HTML Java config @Configuration @EnableWebSocketMessageBroker public class WebSocketConfig implements WebSocketMessageBrokerConfigurer { @Override public void configureMessageBroker(MessageBrokerRegistry config) { config.enableSimpleBroker("/events”); // se.. 2020. 2. 1.
FrontEnd 분리된 SpringMVC 구성시 Controller 구성 welcome controller 생성 import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest; @Slf4j @Controller public class DefaultController { @RequestMapping(value = {""}, produces = {"text/html"}) public String index(HttpServletRequest req) { log.info("index request: {}",.. 2020. 2. 1.