Foros del Web » Programación para mayores de 30 ;) » Java »

Algun error?

Estas en el tema de Algun error? en el foro de Java en Foros del Web. Hola me gustaria saber si veis algun error en esto: @import url("http://static.forosdelweb.com/clientscript/vbulletin_css/geshi.css"); Código HTML: Ver original package Actions;   import EJBS.*; import java.util.*; import javax.ejb.EJB; ...
  #1 (permalink)  
Antiguo 26/02/2011, 10:50
 
Fecha de Ingreso: diciembre-2010
Mensajes: 459
Antigüedad: 13 años, 4 meses
Puntos: 21
Algun error?

Hola me gustaria saber si veis algun error en esto:

Código HTML:
Ver original
  1. package Actions;
  2.  
  3. import EJBS.*;
  4. import java.util.*;
  5. import javax.ejb.EJB;
  6. import javax.naming.*;
  7. import javax.servlet.http.*;
  8. import org.apache.struts.action.*;
  9.  
  10. @EJB (name="carrito2", beanInterface=OperacionesLocal.class)
  11. public class carritoAction extends org.apache.struts.action.Action {
  12.  
  13.     private static final String SUCCESS = "compra";
  14.     private  ArrayList<Producto> al=null;
  15.     private   boolean existe;
  16.  
  17.     @Override
  18.     public ActionForward execute(ActionMapping mapping, ActionForm form,
  19.             HttpServletRequest request, HttpServletResponse response)
  20.             throws Exception {
  21.         HttpSession ses = request.getSession();
  22.         al=new ArrayList<Producto>();
  23.      
  24.         Producto p;
  25.         System.out.print("entro aki ");
  26.         Context ctx=new InitialContext();
  27.         OperacionesLocal cl=(OperacionesLocal) ctx.lookup("java:comp/env/carrito2");
  28.         int id=Integer.parseInt(request.getParameter("id"));
  29.         existe=false;
  30.  
  31.        
  32.         p = cl.getLista(id);
  33.        
  34.         if (ses.getAttribute("carrito") == null) {
  35.            
  36.             al.add(p);
  37.             System.out.print("entro aki primero");
  38.  
  39.         } else {
  40.             try {
  41.                 System.out.print("entro aki segundo");
  42.                 al = (ArrayList<Producto>) ses.getAttribute("carrito");
  43.                 for (int i = 0; i < al.size(); i++) {
  44.                    System.out.print("id p" + p.getId() + "id" + id + p.getNombre() + "id al" + al.get(i).getId() + "hola" + al);
  45.                    System.out.print(al.get(i).getId() + "=" + id);
  46.                    if (al.get(i).getId() == p.getId()) {
  47.                        System.out.print("se repite");
  48.                        existe = true;
  49.                    }
  50.  
  51.                }
  52.                if (existe != true) {
  53.  
  54.                    al.add(p);
  55.                }
  56.            } catch (Exception ex) {
  57.                System.out.print("salta excepcion");
  58.                return null;
  59.            }
  60.  
  61.        }
  62.  
  63.        System.out.print("valor existe"+existe);
  64.        ses.setAttribute("carrito",al);
  65.  
  66.        return mapping.findForward(SUCCESS);
  67.    }
  68. }

Saludos
  #2 (permalink)  
Antiguo 28/02/2011, 14:41
Avatar de jhonmelguizo  
Fecha de Ingreso: enero-2008
Ubicación: Medellín - Colombia
Mensajes: 264
Antigüedad: 16 años, 3 meses
Puntos: 6
De acuerdo Respuesta: Algun error?

La pregunta es, qué error te arroja al compilar?

Saludos...
__________________
¡No competimos, compartimos!...
  #3 (permalink)  
Antiguo 28/02/2011, 14:41
 
Fecha de Ingreso: diciembre-2010
Mensajes: 459
Antigüedad: 13 años, 4 meses
Puntos: 21
Respuesta: Algun error?

Hola ya lo soluciones, el problema era q solo funciona en firefox y no en ie 8

Gracias por tu interes

Saludos

Etiquetas: Ninguno
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 02:14.