Пример #1
0
 public UsutareaBean loadId(UsutareaBean oUsutarea) throws ServletException {
   try {
     if (request.getParameter("id") != null) {
       oUsutarea.setId(Integer.parseInt(request.getParameter("id")));
     } else {
       oUsutarea.setId(0);
     }
   } catch (NumberFormatException e) {
     throw new ServletException(
         "Controller: Error: loadId: Formato de datos en parámetros incorrecto " + e.getMessage());
   }
   return oUsutarea;
 }
Пример #2
0
  public UsutareaBean load(UsutareaBean oUsutarea) throws NumberFormatException, ParseException {
    try {

      if ((request.getParameter("id_usuario") != null)) {
        oUsutarea.getUsuario().setId(Integer.parseInt(request.getParameter("id_usuario")));
      }
      if ((request.getParameter("id_tarea") != null)) {
        oUsutarea.getTarea().setId(Integer.parseInt(request.getParameter("id_tarea")));
      }
    } catch (NumberFormatException e) {
      throw new NumberFormatException(
          "UsutareaParam: Error: load: Formato de datos en parámetros incorrecto "
              + e.getMessage());
    }
    return oUsutarea;
  }