Skip to content

Instantly share code, notes, and snippets.

View keesun's full-sized avatar
📺
On Air

Keesun Baik (a.k.a, Whiteship) keesun

📺
On Air
View GitHub Profile
@keesun
keesun / application.properties
Created July 2, 2018 04:50
Spring Boot SSL Sample (self signed)
server.ssl.key-store: keystore.p12
server.ssl.key-store-password: 123456
server.ssl.keyStoreType: PKCS12
server.ssl.keyAlias: tomcat
@keesun
keesun / AsyncServlet.java
Created January 16, 2012 16:32
Servlet 3.0's Asynchronous Support sample
package me.whiteship.board.modules.servlet.async;
import javax.servlet.AsyncContext;
import javax.servlet.AsyncEvent;
import javax.servlet.AsyncListener;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@keesun
keesun / ApiClientUtils.java
Last active February 17, 2021 10:09
API 서버 사용 예제 코드
package herma.common;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate;
import java.io.IOException;
import java.nio.charset.Charset;
@keesun
keesun / PathVariableTests.java
Created April 13, 2012 02:28
PathVariable Tests
package pathvariable;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.stereotype.Controller;
import org.springframework.test.web.server.MockMvc;
import org.springframework.test.web.server.setup.MockMvcBuilders;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@keesun
keesun / CorsInterceptor.java
Created March 30, 2012 00:16
CORS Spring Interceptor Demo
package cors;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* @author Keesun Baik
@keesun
keesun / AppConfig.java
Created January 18, 2012 15:36
Spring 3.1's Configurer Pattern
@Configuration
@EnableHello
public class AppConfig implements NameConfigurer {
@Override
public void configure(Hello hello) {
hello.setName("Thank you very much, Toby.");
}
}
@keesun
keesun / FileUploadServlet.java
Created January 13, 2012 03:19
Servlet 3.0's FileUpload Sample
@WebServlet("/upload")
@MultipartConfig(location = "/tmp")
public class FileUploadServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
getServletContext().getRequestDispatcher("/WEB-INF/views/fileUpload.jsp").forward(req, res);
}
@Override
@keesun
keesun / AppConfig.java
Created January 18, 2012 14:13
Spring 3.1's @import, @enable and ImportAware
@Configuration
@EnableHello(name = "Keesun")
public class AppConfig {
}
@keesun
keesun / test.md
Created December 19, 2013 13:40
깃헙 Gist 코멘트 API 테스트

여기에 댓글을 보내보세요.

@keesun
keesun / BookControllerTest.groovy
Last active December 23, 2015 23:39
spock + spring mvc test: using mock
package whiteship
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.setup.MockMvcBuilders
import spock.lang.Specification
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status
/**
* @author Keesun Baik