【发布时间】:2012-10-22 03:21:04
【问题描述】:
我知道从 img 标签 src 调用 servlet 的 doPost 方法没有任何意义:
<img src='/ServletName' alt=''/>// i know it will call doGet or service method but i can't use these.
那么有没有办法从html的img标签调用doPost方法并在img标签中显示图像?
其实我的doPost方法响应类型是:
response.setContentType("image/jpeg");
我也无法在服务器磁盘上存储图像。
【问题讨论】:
-
用HTTP POST方式提交表单时调用。
-
Post 是向服务器发送数据。您尝试做的奇怪事情绝对是
get。图像必须永久存储在某个地方吗?除非你动态生成它...... -
感谢您的评论,所以我想我的问题的答案是否定的。