Home » Fusion Middleware & Colab Suite » Weblogic & Application Server » servlets became file download
servlets became file download [message #193118] Thu, 14 September 2006 23:22 Go to next message
cacheboy
Messages: 21
Registered: August 2006
Junior Member
All my servlets when ran, Oracle 10g AS treats it as a download instead of html.

In my servlet, I already set

response.setContentType("text/html; charset=UTF-8");
PrintWriter out = response.getWriter();
out.println();

What gives?

After I download the file and open with a text editor, it is showing the html I wanted to show.

Don't have this problem on other Application Server.

Please help. Thanks.

Re: servlets became file download [message #193141 is a reply to message #193118] Fri, 15 September 2006 00:56 Go to previous message
cacheboy
Messages: 21
Registered: August 2006
Junior Member
Found the error after searching the web for a long time.

PrintWriter out = response.getWriter();
response.setContentType("text/html; charset=UTF-8");
out.println();

Is the problem.
You must setContentType in response before you getWriter for out.
Previous Topic: Forms trace question
Next Topic: splitting oracle on unix from one user to three (infra,app and db) is this possible?
Goto Forum:
  


Current Time: Sat Dec 07 02:35:05 CST 2024