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();
}
Sonraki Ben tarif here olarak JSON POJO desteğini etkinleştirmek istiyorum ama sorun ben (bir web.xml dosyası üzerinden programlı ziyade yapmak istiyorum olmasıdır Bir web.xml dosyası yok!).
JSON POJO eşleme özelliğini etkinleştirmek için yukarıdaki kodu nasıl değiştirebilirim?