How can I include a JFreeChart servlet image in a JSP

大兔子大兔子 提交于 2019-12-02 01:07:29

You're going about it the right way. You may be having some kind of relative path issue from the context you're in. Try

<img src="http://<full path to your servlet>" ...

Also, you have a ?id=274 in your example, but not in your img src. If that's required, put that in there as well.

If you posted your servlet code, that could help, but also make sure you have your content type set properly in your servlet

response.setContentType("image/jpeg");  
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!