@WebServlet("/findPerson")
public class FindPerson extends HttpServlet {
// ... doGet implementation
@Override
protected void doPost( HttpServletRequest request, HttpServletResponse response )
throws ServletException, IOException {
// data to send to the client
String name = "John White";
int age = 54;
// Adding attributes to the request
request.setAttribute( "personName", name );
request.setAttribute( "personAge", age );
}
}
}
How do I get the value of these attributes "personName" and "personAge" in angular after calling
return this.http.post('http://localhost:8080/findPerson',"");