Hi all.
Im sorry, if this question does't concern this conference.
I can't receive the ask from developer (PROGRESS Apptivity).
I have the following problem:
there are *.html files are containing Java API instances.
These instance are intened for work with Database (on the main).
I.e. JDBC-ODBC is used.
I can't obtain for data from database and HTML text look in same code
page.
That is, if I'm writing in servlet res.setContentType("text/html;
charset=Cp1251");
(res is HttpServletResponse parameter from
public void service(HttpServletRequest req, HttpServletResponse res)),
then any text from *.html is being wrote in Russian is looking OK, but
any data from database as '?'.
And on the contrary, if I use res.setContentType on default (it's
ISO-8859-1),
then any text from *.html is being wrote in Russian is looking as '?',
but
any data from database OK.
What about JDK, I use 1.1.7B.
If I try to convert out stream in servlet:
PrintWriter out = new PrintWriter(
new
OutputStreamWriter(res.getOutputStream(), "Cp1251"),
true);
I get the next error during the runnig:
java.lang.IllegalStateException: can't mix text and binary input
at sun.servlet.http.HttpResponse.getWriter(HttpResponse.java:628)
at intershopServlet.service(intershopServlet.java:176)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at
sun.servlet.http.HttpServerHandler.sendResponse(HttpServerHandler.java:165)
at
sun.servlet.http.HttpServerHandler.handleConnection(HttpServerHandler.java:1
21)
at sun.servlet.http.HttpServerHandler.run(HttpServerHandler.java:90)
at java.lang.Thread.run(Thread.java:466)
By the way for out of data servlet use two streams PrintWriter and
ServletOutputStream.
I realize, that something is wrong in
WebBrowser (Cp1251) <-- servlet(Unicode) <-- *.html (Cp1251),
but how it may be overcome, I don't know.
Could somebody tell me, what I must do, and where I'm wrong?
With respects.
Vika.
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html