You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Wyn Easton <wy...@yahoo.com> on 2000/11/08 15:02:30 UTC
Skills Challenge - off topic
Hi All,
I just changes several JSPs to support language translations.
I added <%@ page contentType="text/html;charset=utf-8"%>
to the beginning of all of my JSPs. This is great for NLS, but
the Netscape JavaScript Debugger only understands US ASCII and
will not work with utf-8 (bummer).
Now the challenge...
How can I somehow set a debug flag in my JSPs to use US ASCII
if the flag is set and UTF-8 if not?
I've tried surrounding the "page" JSP tag with an "if", but
the page directive is processed first and moved to the beginning of
the generated java file. I've tried replacing the String
"text/html;charset=utf-8" with a String variable, no luck.
Hmmm...
=====
Wyn Easton
wyn_easton@yahoo.com
__________________________________________________
Do You Yahoo!?
Thousands of Stores. Millions of Products. All in one Place.
http://shopping.yahoo.com/
Re: Skills Challenge - off topic
Posted by Kurt Bernhard Pruenner <le...@gmx.at>.
Wyn Easton wrote:
> How can I somehow set a debug flag in my JSPs to use US ASCII
> if the flag is set and UTF-8 if not?
> I've tried surrounding the "page" JSP tag with an "if", but
> the page directive is processed first and moved to the beginning of
> the generated java file. I've tried replacing the String
> "text/html;charset=utf-8" with a String variable, no luck.
> Hmmm...
How about using
<%
if (DEBUG)
response.setContentType("text/html;charset=utf-8")
else
response.setContentType("text/html;charset=<whatever>")
%>
somewhere in the beginning of the page? You could probably put this and other
things you need on every page into a seperate file and just use
<%@ include file="<whatever>.jsp" %>
at the top of your files...
Problem solved? :)
--
Kurt Pruenner - Haendelstrasse 17, 4020 Linz, Austria | Briareos at Olymp BBS:
http://www.mp3.com/Leak http://www.ssw.uni-linz.ac.at | ssh bbs@138.232.112.32
...........It might be written "Mindfuck", but it's spelt "L-A-I-N"...........
np: Vladislav Delay - Pietola (Multila)