Пример #1
0
 @Override
 protected Player getFromMapper(Long id) throws MapperException, DomainObjectCreationException {
   try {
     return PlayerInputMapper.find(id);
   } catch (Exception e) {
     // It better be here! That null won't go over well!
     e.printStackTrace();
     return null;
   }
 }
Пример #2
0
  @Override
  protected void processRequest(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    setupRequest(request);

    try {

      // Do Stuff
      List<IPlayer> players = PlayerInputMapper.findAll();
      request.setAttribute("players", players);

      // Commit
      DbRegistry.getDbConnection().commit();

      // Forward to a jsp, make sure you fill it in properly
      request.getRequestDispatcher("/WEB-INF/jsp/xml/players.jsp").forward(request, response);
    } catch (Exception e) {
      forwardError(request, response, e.getMessage());
      e.printStackTrace();
    } finally {
      teardownRequest();
    }
  }