P
prado
Can anybody try this JSP from 2 browsers at the time?
So you can see the problem.
You can see the log
--------------------------JSP------------------------------------------------------
<%@page contentType="application/vnd.ms-excel"%>
<%@ page language="java" import="java.io.*"%>
<%@ page language="java" import="java.util.*"%>
<%
Date fecha = new Date();
java.sql.Date fechaSQL = new java.sql.Date(fecha.getTime());
Calendar calendario = Calendar.getInstance();
calendario.setTime(fecha); // fecha es el Date de antes.
String strHour = String.valueOf( calendario.get(Calendar.HOUR) );
String strMinute = String.valueOf( calendario.get(Calendar.MINUTE) );
String strSecond = String.valueOf( calendario.get(Calendar.SECOND) );
String nombre = "FILE" + strHour + strMinute + strSecond + ".xls";
System.out.println( " IN OF " + nombre );
response.setContentType( "application/x-download" );
response.setHeader("Content-type","application/vnd.ms-excel");
response.setHeader("Content-Disposition","attachment; filename=\""
+ nombre + "\"");
System.out.println( nombre + " START" );
for (int l=0;l<15000;l++){
System.out.println( nombre + " " + l );
for (int k=0;k<250;k++){
out.write(nombre + " : ("+ l + "," + k + ")" + "\t" );
}
out.write("\n");
}
System.out.println( nombre + " END" );
%>
So you can see the problem.
You can see the log
--------------------------JSP------------------------------------------------------
<%@page contentType="application/vnd.ms-excel"%>
<%@ page language="java" import="java.io.*"%>
<%@ page language="java" import="java.util.*"%>
<%
Date fecha = new Date();
java.sql.Date fechaSQL = new java.sql.Date(fecha.getTime());
Calendar calendario = Calendar.getInstance();
calendario.setTime(fecha); // fecha es el Date de antes.
String strHour = String.valueOf( calendario.get(Calendar.HOUR) );
String strMinute = String.valueOf( calendario.get(Calendar.MINUTE) );
String strSecond = String.valueOf( calendario.get(Calendar.SECOND) );
String nombre = "FILE" + strHour + strMinute + strSecond + ".xls";
System.out.println( " IN OF " + nombre );
response.setContentType( "application/x-download" );
response.setHeader("Content-type","application/vnd.ms-excel");
response.setHeader("Content-Disposition","attachment; filename=\""
+ nombre + "\"");
System.out.println( nombre + " START" );
for (int l=0;l<15000;l++){
System.out.println( nombre + " " + l );
for (int k=0;k<250;k++){
out.write(nombre + " : ("+ l + "," + k + ")" + "\t" );
}
out.write("\n");
}
System.out.println( nombre + " END" );
%>