i am facing in writing get method can any one help in correcting error : i want to retrive the data using rest api response and display in my html page here is the code i have written so far.can anyone help me in writting the correct code and i am new to use web servces.
when i insert into database using rest api it is inserted. I want the data that is inserted into the database through the rest api response and i want to display the same result in web page.

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    <!DOCTYPE html>
    <html>
    <head>
      <title>AngularJS File Upoad Example with $http and FormData</title>
      <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script>
    </head>

    <body ng-app="myApp">
    <div ng-controller="MyController">
    <table>
    	<tr>
    		<td><input type="name" ng-model="contact.name"></td>
    		<td><input type="email" ng-model="contact.username"></td>
    		<td><input type="password" ng-model="contact.password"></td>
    		<td><button ng-click="addContact()">Sign In</button></td>
    		<td><button ng-click="viewContact()">view</button></td>
    	</tr>
    </table>
    </div>
    <script type="text/javascript">
    	var myApp = angular.module('myApp',[]);
    	myApp.controller('MyController',['$scope','$http',function($scope,$http){
        $scope.addContact = function(){
            console.log($scope.contact);
            $http.post('http://localhost:8085/useraccount/register/doregister',$scope.contact);
        };
        $scope.viewContact = function(){
        	console.log($scope.contact);
        	$http.get('http://localhost:8085/useraccount/register/doselect',$scope.contact);
        };
    	}]);
    	
    </script>
    </body>
    </html>

<!-- begin snippet: js hide: false console: true babel: false -->

<!-- language: lang-html -->

    register.java


    package com.registration;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    import java.util.ArrayList;
    import java.util.Map;

    import javax.ws.rs.Consumes;
    import javax.ws.rs.DELETE;
    import javax.ws.rs.FormParam;
    import javax.ws.rs.GET;
    import javax.ws.rs.POST;
    import javax.ws.rs.Path;
    import javax.ws.rs.Produces;
    import javax.ws.rs.QueryParam;
    import javax.ws.rs.core.MediaType;

    import org.json.JSONObject;



    //import org.json.simple.JSONArray;
    //import org.json.simple.JSONObject;
    //import org.json.simple.parser.JSONParser;

    //Path: http://localhost/<appln-folder-name>/register
    @Path("/register")
    public class Register {
    //	public String jsonReader()
    //	{
    //		String response="";
    //	JSONParser parser = new JSONParser();
    //    try
    //    {
    //        Object object = parser
    //                .parse(new FileReader("c:\\sample.json"));
    //        
    //        //convert Object to JSONObject
    //        JSONObject jsonObject = (JSONObject)object;
    //        String name = (String) jsonObject.get("name");
    //        String uname=(String) jsonObject.get("username");
    //        String pwd=(String) jsonObject.get("password");
    //        System.out.println("Name: " + name);
    //        System.out.println("EmailId"+uname); 
    //        System.out.println("Password"+pwd);
    //    }catch(Exception e)
    //    {
    //        e.printStackTrace();
    //    }
    //	}
    	// HTTP Get Method
    	@POST
    	// Path: http://localhost/<appln-folder-name>/register/doregister
    	@Path("/doregister")
    	// Produces JSON as response
    	@Produces(MediaType.APPLICATION_JSON)
    	@Consumes(MediaType.APPLICATION_JSON)
    	// Query parameters are parameters:
    	// http://localhost/<appln-folder-name>/register/doregister?name=pqrs&username=abc&password=xyz
    	public String doLogin(String json)  {
    		JSONObject jsonobject = new JSONObject(json);
    		System.out.println(jsonobject);
    		String name=(String) jsonobject.get("name");
    		String uname=(String) jsonobject.get("username");
    		String pwd=(String) jsonobject.get("password");
    		String response = "";
    		System.out.println("name"+name);
    		System.out.println("username"+uname);
    		System.out.println("password"+pwd);
    		int retCode = registerUser(name, uname, pwd);
    		if (retCode == 0) {
    			response = Utility.constructJSON("register", "Successfully Registered");
    		} else if (retCode == 1) {
    			response = Utility.constructJSON("register", "You are already registered");
    		} else if (retCode == 2) {
    			response = Utility.constructJSON("register", 
    					"Special Characters are not allowed in Username and Password");
    		} else if (retCode == 3) {
    			response = Utility.constructJSON("register", "Error occured");
    		}
    		return response;

    	}

    	private int registerUser(String name, String uname, String pwd) {
    		System.out.println("Credentials are correct");
    		int result = 3;
    		
    		if (Utility.isNotNull(uname) && Utility.isNotNull(pwd)) {
    			try {
    				if (DbConnection.insertUser(name, uname, pwd)) {
    					System.out.println("User Registered");
    					result = 0;
    				}
    			} catch (SQLException sqle) {
    				System.out.println("U are already Registered");

    				if (sqle.getErrorCode() == 1062) {
    					result = 1;
    				}

    				else if (sqle.getErrorCode() == 1064) {
    					System.out.println(sqle.getErrorCode());
    					result = 2;
    				}
    			} catch (Exception e) {
    				// TODO Auto-generated catch block
    				System.out.println("Inside checkCredentials catch e ");
    				result = 3;
    			}
    		} else {
    			System.out.println("Inside checkCredentials else");
    			result = 3;
    		}

    		return result;
    	}

    	@GET
    	@Path("/doselect")
    	@Produces(MediaType.APPLICATION_JSON)
    	public String selectUser() {
    		Connection con = null;
    		String response = "";
    		ArrayList<String> al = new ArrayList<String>();
    		try {
    			Class.forName(Constants.dbClass);
    			con = DriverManager.getConnection(Constants.dbUrl, Constants.dbUser, Constants.dbPwd);
    			Statement stmt = con.createStatement();
    			ResultSet rs = stmt.executeQuery("select * from user");
    			while (rs.next())
    				al.add(rs.getString(1));
    			response = Utility.selectJson(al);
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    		return response;
    	}

    @DELETE
    @Path("/dodelete")
    public String deleteUser(@QueryParam("username") String uname)
    {
    	//boolean deleteStatus = false;
    	Connection con = null;
    	String response="";
    	//int result=2;
    	
        try {
            Class.forName(Constants.dbClass);
            con = DriverManager.getConnection(Constants.dbUrl, Constants.dbUser, Constants.dbPwd);
            String query="delete from user where username='"+uname+"' ";
            Statement stmt=con.createStatement();
           stmt.executeUpdate(query);
           System.out.println("Deleted");
            response=Utility.constructJSON("deleted", "deleted successsfully");
      }
        
        catch(Exception e)
        {
        	e.printStackTrace();
        	
        }
        return response;
    }
    }


<!-- end snippet -->

    