annotation 3

JAX-RS의 구성

1. Root Resource Classes * 웹 리소스을 구현하기 위해 JAX-RS 어노테이션을 사용하는 자바 클래스 적어도 하나의 메소드에 @Path을 사용한 POJO Root resource class들은 JAX-RS runtime에 인스턴스화된다. @Path 어노테이션이 달린 Resource 클래스 @Path("/hi") public class HiResource { @GET @Produces("text/plain") public String getAsText() { return "Hi! buri. Show Text."; } 2. Resource Methods @GET @POST @PUT @DELETE @HEAD * URI Templates @Path annotation의 값은 상대 경로 URI..

backend 2009.06.01

[Spring] @Autowired의 Before/After

Spring framework 2.5에 추가된 @Autowired annotation에 관한 글을 보고 정리. 알고있는 내용이기에~ 그냥 가볍게 Before 와 After code Before - @Autowired annotation이 없었을 때 applicationContext.xml에서 설정 EmpDao의 bean을 inject public class EmpManager { private EmpDao empDao; public EmpDao getEmpDao() { return empDao; } public void setEmpDao(EmpDao empDao) { this.empDao = empDao; } ... } 이랬던 코드가~ 바뀐다. After applicationContext.xml에서 설정..

backend/Spring 2009.04.29

[iBATIS] 8. Annotation 기반으로 JUnit4를 이용한 Spring TDD ~ 9. Reference

8. Annotation 기반으로 JUnit4를 이용한 Spring TDD @TransactionConfiguration(transactionManager = "transactionManager", defaultRollback=true) @RunWith : 테스트를 실행할 org.junit.runner.Runner 구현 클래스를 지정할 수 있다. 스프링은 스프링 컨텍스트 설정 및 DI, 트랜잭션 처리 등을 지원해주는 Runner 구현 클래스를 제공하고 있다. Junit 4 기반의 테스트에서 스프링 컨텍스트에 설정된 빈 객체를 사용하고 싶다면 SpringJunit4ClassRunner 클래스를 @RunWith 어노테이션 값으로 설정하면 된다. @ContextConfiguration : 스프링 컨텍스트를 생..

backend/iBatis 2008.09.03