Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/05/2009, 15:27
ChrissVN
 
Fecha de Ingreso: mayo-2009
Mensajes: 25
Antigüedad: 15 años
Puntos: 0
Error con JSP de una clase Deprecated

Hola a todos espero que me puedan ayudar.

Buscando en Internet encontré una función para conseguir la cantidad de dias transcurridos desde el día actual. la comence a modificar en eclipse y si FUNCIONÓ. pero al usarla con una página JSP bajo Dreamweaver y Tomcat me manda un error:

Estado HTTP 500 -

type Informe de Excepci�n

mensaje

descripci�n El servidor encontr� un error interno () que hizo que no pudiera rellenar este requerimiento.

excepci�n

org.apache.jasper.JasperException: No se puede compilar la clase para JSP:

Ha tenido lugar un error en la l�nea: 133 en el archivo jsp: /presentacion/listaHabitacion2.jsp
The type Date is ambiguous
130: //Convert date passed as String in a Calendar.date data type
131: fecha2.set(Integer.parseInt(diaS),Integer.parseInt (mesS), Integer.parseInt(anioS),0,0,0);
132: //Convierte a long en milisegundos las dos fechas para restarlas
133: long f1 = Date.parse(fecha1.getTime().toString());
134: long f2 = Date.parse(fecha2.getTime().toString());
135: //Substrac two dates in miliseconds
136: long diff = f2 - f1;

Bueno el codigo completo de la funcion se los dejo.....

String fechaSalida = request.getParameter("fecha_regreso");
char fS[] = fechaSalida.toCharArray(); //Convierte la fecha a un arreglo de chars
String diaS="",mesS="",anioS=""; //Variables para separar dias, mes, anio
diaS = diaS.concat(String.valueOf(fS[0]));
diaS = diaS.concat(String.valueOf(fS[1]));
diaS = diaS.concat(String.valueOf(fS[2]));
diaS = diaS.concat(String.valueOf(fS[3]));

mesS = mesS.concat(String.valueOf(fS[5]));
mesS = mesS.concat(String.valueOf(fS[6]));

anioS = anioS.concat(String.valueOf(fS[8]));
anioS = anioS.concat(String.valueOf(fS[9]));


Calendar fecha1 = Calendar.getInstance();//current date
Calendar fecha2 = Calendar.getInstance(); //FechaSalida
//Convert date passed as String in a Calendar.date data type
fecha2.set(Integer.parseInt(diaS),Integer.parseInt (mesS), Integer.parseInt(anioS),0,0,0);
//Convierte a long en milisegundos las dos fechas para restarlas
long f1 = Date.parse(fecha1.getTime().toString());
long f2 = Date.parse(fecha2.getTime().toString());
//Substrac two dates in miliseconds
long diff = f2 - f1;
// Pasamos a días
//Convert miliseconds at days
long dias = diff / (1000 * 60 * 60 * 24) +1;