Beispiel #1
0
 /**
  * Procesa los llamados a listar marcas
  *
  * @param
  * @return
  * @throws IOException
  * @throws ServletException
  */
 public void doGet(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
   BrandRepository brands = (BrandRepository) context.getBean("brandRepository");
   Collection data_brands = brands.findAllBrand();
   List param_brands = new ArrayList();
   Iterator itr = data_brands.iterator();
   while (itr.hasNext()) {
     Brand brand = (Brand) itr.next();
     BrandDTO dto = BrandAssembler.Create(brand);
     param_brands.add(dto);
   }
   request.setAttribute("brands", param_brands);
   forward("/ListBrands.jsp", request, response);
 }
Beispiel #2
0
 public void doGet(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
   ProfesorRepository profesores = (ProfesorRepository) context.getBean("profesorRepository");
   try {
     Collection lista = profesores.findAllProfesor();
     List data = new ArrayList();
     Iterator itr = lista.iterator();
     while (itr.hasNext()) {
       Profesor prof = (Profesor) itr.next();
       ProfesorDTO dto = ProfesorAssembler.Create(prof);
       data.add(dto);
     }
     request.setAttribute("profesores", data);
     forward("/listaProfesores.jsp", request, response);
   } catch (Exception e) {
     request.setAttribute("mensaje", e.getMessage());
     forward("/paginaError.jsp", request, response);
   }
 }
 public void doGet(HttpServletRequest request, HttpServletResponse response)
     throws ServletException, IOException {
   GrupoRepository grupos = (GrupoRepository) context.getBean("grupoRepository");
   try {
     Collection lista = grupos.findAllGrupo();
     List data = new ArrayList();
     Iterator itr = lista.iterator();
     while (itr.hasNext()) {
       Grupo grupo = (Grupo) itr.next();
       GrupoDTO dto = GrupoAssembler.CreateDTO(grupo);
       data.add(dto);
     }
     request.setAttribute("grupos", data);
     forward("/listaGrupos.jsp", request, response);
   } catch (Exception e) {
     request.setAttribute("mensaje", e.getMessage());
     forward("/paginaError.jsp", request, response);
   }
 }