<Jetty Version : 9.0.4>
필수 Jetty Library : jetty-servlet, servlet-api (Maven으로 의존관계의 Library 관리)
private static final String JERSEY_RESOURCES = "리소스패키지(ex. net.yongbi.rest)";
Server server = new Server(port);
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
server.setHandler(context);
ServletHolder h = new ServletHolder(new ServletContainer());
h.setInitParameter("com.sun.jersey.config.property.packages", JERSEY_RESOURCES);
context.addServlet(h, "/*");
server.start();
server.join();
댓글을 달아 주세요
댓글 RSS 주소 : http://www.yongbi.net/rss/comment/577