private static URI getBaseURI() {
return UriBuilder.fromUri("http://localhost/").port(9998).build();
}
public static final URI BASE_URI = getBaseURI();
protected static HttpServer startServer() throws IOException {
System.out.println("Starting grizzly...");
final ResourceConfig rc = new PackagesResourceConfig("amplify.api.resources");
return GrizzlyServerFactory.createHttpServer(BASE_URI, rc);
}
public static void main(final String[] args) throws IOException {
final HttpServer httpServer = startServer();
System.out.println(String.format("Jersey app started with WADL available at "
+ "%sapplication.wadl\nTry out %shelloworld\nHit enter to stop it...", BASE_URI, BASE_URI));
System.in.read();
httpServer.stop();
}
다음 내가 설명 here로 JSON POJO 지원을 활성화 할을하지만, 문제는 내가 (web.xml 파일을 통해 프로그래밍보다는 그것을 할 것입니다 web.xml 파일이 없습니다!).
JSON POJO 매핑 기능을 사용하려면 위의 코드를 어떻게 수정할 수 있습니까?