You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Marcos Martinez <ma...@vfh.hs-bremerhaven.de> on 2000/04/28 15:16:43 UTC

servlet respose is not interpeted by the browser

My problem is that when i get the output of one servlet, the only thing
which i am able to see, is the html page, as if it was a test file, I
mean that i get in my broser all the code of the dinamic html page which
was generated by the servlet. it seems like my browser was not able to
understand html, and the display the source code instead of the real
content. 


Thanks for all.

Re: servlet respose is not interpeted by the browser

Posted by "Satyadeep S. M." <sa...@alopa.com>.
Hi,

On Fri, Apr 28, 2000 at 03:16:43PM +0200, Marcos Martinez wrote:
> My problem is that when i get the output of one servlet, the only thing
> which i am able to see, is the html page, as if it was a test file, I
> mean that i get in my broser all the code of the dinamic html page which
> was generated by the servlet. it seems like my browser was not able to
> understand html, and the display the source code instead of the real
> content. 

Did you check if the content type is set to text/html ?

regards
satya

-- 
Satyadeep S. Musuvathy,

Member, Technical Staff,
Alopa Networks Private Limited,
17/1, Vittal Mallya Road,
Bangalore - 560 001

Tel/Fax: +91-80-299-6800/01
Email: satya.sm@alopa.com

Re: servlet respose is not interpeted by the browser

Posted by "Satyadeep S. M." <sa...@alopa.com>.
Hi,

On Fri, Apr 28, 2000 at 03:16:43PM +0200, Marcos Martinez wrote:
> My problem is that when i get the output of one servlet, the only thing
> which i am able to see, is the html page, as if it was a test file, I
> mean that i get in my broser all the code of the dinamic html page which
> was generated by the servlet. it seems like my browser was not able to
> understand html, and the display the source code instead of the real
> content. 

Did you check if the content type is set to text/html ?

regards
satya

-- 
Satyadeep S. Musuvathy,

Member, Technical Staff,
Alopa Networks Private Limited,
17/1, Vittal Mallya Road,
Bangalore - 560 001

Tel/Fax: +91-80-299-6800/01
Email: satya.sm@alopa.com

Re: servlet respose is not interpeted by the browser

Posted by Jim Rudnicki <jd...@pacbell.net>.
I'm 99% sure you are missing this

  response.setContentType("text/html");

In your servlet doGet().  This statement causes the MIME type to be
prepended to the output.  The browser is looking for this to determine what
to do with the data that follows.  The browser does not guess that the data
is html, text, jpeg, gif, etc.

gnite
Jim
----- Original Message -----
From: "Marcos Martinez" <ma...@vfh.hs-bremerhaven.de>
To: <ge...@jakarta.apache.org>; <to...@jakarta.apache.org>
Sent: Friday, April 28, 2000 6:16 AM
Subject: servlet respose is not interpeted by the browser


> My problem is that when i get the output of one servlet, the only thing
> which i am able to see, is the html page, as if it was a test file, I
> mean that i get in my broser all the code of the dinamic html page which
> was generated by the servlet. it seems like my browser was not able to
> understand html, and the display the source code instead of the real
> content.
>
>
> Thanks for all.
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org
>