如何在JSP中获取图像而不只是在浏览器中获取图像
<img>在浏览器地址栏中输入包含该元素的JSP文件的URL 。
http:// localhost:8080 / contextname / webplugin / jsp / profile /
photos.jsp
如何避免上述异常?
*从servlet代码中 *删除 以下几行。
//Redirect it to profile pageRequestDispatcher rd = request.getRequestDispatcher ("/webplugin/jsp/profile/photos.jsp");rd.forward(request, response);servlet应该只返回图像。而已。应该由网络浏览器本身下载并显示图像,而不是由网络服务器。



