diff --git a/beans/Users.java b/beans/Users.java index a2b047d2a39e6478053af17c3959aa5a7f377da3..0458bc26d83608de6358ed6d8b388919fa9eea3b 100644 --- a/beans/Users.java +++ b/beans/Users.java @@ -17,9 +17,10 @@ public class Users { @XmlElement(name="users") private List userslist; + private static Users instance; - public Users() { + private Users() { userslist = new ArrayList(); } @@ -31,10 +32,12 @@ public class Users { } public synchronized List getUserslist() { + return new ArrayList<>(userslist); + } - public void setUserslist(List userslist) { + public synchronized void setUserslist(List userslist) { this.userslist = userslist; } diff --git a/services/HelloWorld.java b/services/HelloWorld.java index da6343297b3c15ecba8f32e2abb49875250bc679..bb0085181f0bf2120c3c93895d3da8baf8cc5111 100644 --- a/services/HelloWorld.java +++ b/services/HelloWorld.java @@ -28,13 +28,16 @@ public class HelloWorld { @GET @Produces("application/json") public String helloWorld2(){ + return "{\"message\": \"helloWorld\"}"; + } - @Path("/inner") + @Path("inner") @GET @Produces("text/plain") public String innerHello(){ + return "Inner Hello!"; }