@Path("/users") public class UserResource { @GET @Produces(MediaType.APPLICATION_JSON) public User getUser() { User user = new User("John", "Doe"); return user; } } public class User { private String firstName; private String lastName; public User(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } // Getters and setters }


上一篇:
下一篇:
切换中文