确实可以,非常感谢。分享一下代码——
protected void service( HttpServletRequest req, HttpServletResponse resp )
throws ServletException, IOException
{
String url = req.getParameter( "url" );
int index = url.lastIndexOf( '/' );
String filename = "attachment; filename=" + url.substring( index + 1 );
resp.setHeader( "Content-type", "application/octet-stream" );
resp.setHeader( "Content-Disposition", filename );
getServletContext().getRequestDispatcher( url ).forward( req, resp );
}
【 在 marsteel (K ) 的大作中提到: 】
:
http://www.iteye.com/problems/55520--
FROM 114.248.90.*