File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Images,Template Text ,mime-type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Images,Template Text ,mime-type" Watch "Images,Template Text ,mime-type" New topic
Author

Images,Template Text ,mime-type

James Mark
Ranch Hand

Joined: Jul 05, 2007
Posts: 115
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.


SCJP1.4(96%) SCWCD1.4(92%)
James Mark
Ranch Hand

Joined: Jul 05, 2007
Posts: 115
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

Joined: Apr 20, 2002
Posts: 510
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

Joined: Jul 05, 2007
Posts: 115
Thanks Michael
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Images,Template Text ,mime-type
 
Similar Threads
web.xml causes 404 error
Apache2 / Tomcat 6 / GWT 2.0 - Could use some help
Mistakenly changed web.xml
Configuring Tomcat 5 on Win2K and Linux
Displaying an image in a servlet