Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/04/2012, 11:23
Avatar de gianfranc
gianfranc
 
Fecha de Ingreso: octubre-2011
Ubicación: san isidro-peru
Mensajes: 21
Antigüedad: 12 años, 6 meses
Puntos: 0
Respuesta: direccionar a Action en Struts

ayuda por favor lo ke pasa es que n llega a mi action he tenido que crear un servlet el cual me envia a lo ke kiero pero quiero hacerlo en un action de strus

<a href="AutoServlet?accion=DEL">[B](ESTO ES LO KE SI FUNCIONA)

<html:link accion="listaauto.do?accion=DEL">(ESTO ES LO KE NO FUNCIONA)



en el action y en el servlet:


action:(AKI KIERO KE LLEGUE PERO NO LO HACE)

if(accion.compareTo("DEL")==0){


try {
// Capturar el codigo
int codigo = Integer.parseInt(request.getParameter("idauto"));
// Llamar al DAO pa eliminar
boolean mensaje= new AutoService().eliminarAuto(codigo);
// Llamar al listado

return mapping.findForward(succes);

PROBE PONIENDO UN SYSTEM.OUT.PRINT PERO SALE NADA EN LA CONSOLA ENTONCES SUÚSE KE NO LLEGABA AKI


} catch (Exception ex) {
ex.printStackTrace();
// return mapping.findForward(SUCCESS2 );
}


en el servlet:

if(accion.equals("DEL")){(AKI SI LLEGUA


try {
// Capturar el codigo
int codigo = Integer.parseInt(request.getParameter("idauto"));
// Llamar al DAO pa eliminar
boolean mensaje= new AutoService().eliminarAuto(codigo);
// Llamar al listado

if(mensaje==true){

request.getRequestDispatcher("jsp/Mostrarautos.jsp").forward(request, response);
}

} catch (Exception ex) {
ex.printStackTrace();
// return mapping.findForward(SUCCESS2 );
}