Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect a browser after response.content()

Status
Not open for further replies.

cfm

Programmer
Mar 27, 2001
76
CL
Hello,

I have this code,

the dispatcher don't work..

Any idea?

OutputStream out;
String fileName;
String content;
byte[] data;

// Seteo el nombre del archivo
fileName = "vpn_amp.txt";

// Seteo el contenido del archivo
content = "troz";

// Seteo el content type
response.setContentType("application/x-unknown");
response.setContentLength(content.length());
response.setHeader("Content-Disposition", "attachment; filename="+fileName);

// The file content
out = response.getOutputStream();
data = content.getBytes();
out.write(data);

// Close
out.close();

****** this don't work *************
String URL = "/Rating/RatingGetFile.jsp";
getServletContext().getRequestDispatcher(URL).forward( request , response );
***************************************
return;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top