@Override protected void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {
  String userId=getUserId(request);
  DatastoreUtils datastoreUtils=new DatastoreUtils(userId);
  printPage(response,datastoreUtils.getUserLastRunMessage());
  if (!datastoreUtils.hasUserEntity() || datastoreUtils.hasUserQueryFailed()) {
    runQuery(request,response,userId,datastoreUtils);
  }
}

@ Override protected void doGet ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { String userId = getUserId ( request ) ; DatastoreUtils datastoreUtils = new DatastoreUtils ( userId ) ; printPage ( response , datastoreUtils . getUserLastRunMessage ( ) ) ; if ( ! datastoreUtils . hasUserEntity ( ) || datastoreUtils . hasUserQueryFailed ( ) ) { runQuery ( request , response , userId , datastoreUtils ) ; } }
this servlet responds to a get request with a stencil page that will be filled with a chart and a message by client - side javascript . also , if no data exists in the datastore for the current user , it sends a query to retrieve it .
