Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Images,Template Text ,mime-type

 
James Mark
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Consider the scenario in jsps..

Scriplet is used to read an image from the context root using streams.
contains the line
OutputStream os=response.getOutputStream();

Can we include any template text along with it?
I think it will lead to a line out.write("some string") in the generated Servlet corresponding to the jsp page.
there is a constraint that response.getWriter() and response.getOutputStream() cannot be called at the
same time!!!

Suppose I clicked a link and got some images and text in the webpage(as usual ...what is the mime type of the response? is it text/html or image/jpeg.
If a page contains two or more images,what actually comprise the response?
Do we need to send separate request for the images.

In the beginning of HFSJ there is a little talk about this.Please help me regarding this.
 
James Mark
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
now I got it...
one is java.io.PrintWriter and other one is a javax.servlet.jsp.JspWriter....

please consider the next part in the Question....
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am assuming that you are using a JSP to generate an image tag or doing so yourself in the JSP. The return type is text/html. The browser, upon seeing the html image tag will open up another connection to retrieve the image. You do not have to be concerned with this connection. It will be done for you.
 
James Mark
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic