hi folks, i am using the typical command-view model for developing my web application. So before I forward the view to the jsp, the command would prepare the view. If the jsp contains text and images, how would I prepare for it in my command. I know how to stream image, but if I just set the responeHeader to image, the resulting jsp would just display the image and no text is allowed. How can this be done? thanks!
I am using img tags in jsp to show the image, but on the server side I still need to stream the images to the browser. These images are not accessible by the browser without a streaming servlet. So I am not sure how to do this on the server side. thanks!
You realize that the HTML and each image involves a separate request, right? I might not be sure what you're asking. I have a small example app that streams images to a webpage. http://simple.souther.us Download and run SimpleStream. It might answer your question.
Joined: Apr 07, 2004
Thanks I understand now, my confusion was related to the image tag, the image tag's can point to a streaming servlet, right? I thought the image tag can only points to static files
It will be better to add something: if you point the img tag to dynamic resource you should take into account browser caching. It is sometimes bad when browser each time requests the very same stream of bytes
Another bug can be on the contrary: the browser caches the dynamic response and dysplayed info is not always up to date.
To avoid it you can use setting response headers and returning appropriated response status codes.