Пример #1
0
  @RequestMapping("/jogo/escolheAgente")
  public ModelAndView escolheAgente(@RequestParam(value = "agente", required = false) String agente)
      throws ServletException, IOException {

    Map<String, Object> myModel = new HashMap<String, Object>();

    Long ag;

    try {
      ag = Long.parseLong(agente);
    } catch (NumberFormatException e) {
      ag = (long) -1;
    }

    myModel.put("result", (new JSONObject(service.escolheAgente(ag))).toString());

    return new ModelAndView("servico.jsp", "model", myModel);
  }