Discussion:
[Resin-interest] How to set default/global response encoding?
Hans Loeblich
2007-06-27 14:59:10 UTC
Permalink
I need to know if there is any way to make UTF-8 my default charset
encoding. Do I really have to set the page contentType at the top of
every jsp? It currently defaults to ISO-8559-1 if I do not explicitly
set it.

Thank you,
Hans Loeblich
Scott Ferguson
2007-06-27 16:16:36 UTC
Permalink
Post by Hans Loeblich
I need to know if there is any way to make UTF-8 my default charset
encoding. Do I really have to set the page contentType at the top of
every jsp? It currently defaults to ISO-8559-1 if I do not explicitly
set it.
With 3.1.1, you can use <character-encoding>UTF-8</character-
encoding> to set the default charset encoding.

Technically, this goes beyond the spec. JSP defaults to ISO-8859-1
according to the spec, so you do need a contentType for standard JSP.

-- Scott
Post by Hans Loeblich
Thank you,
Hans Loeblich
_______________________________________________
resin-interest mailing list
resin-interest at caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest
Yong Bakos
2007-06-27 16:28:00 UTC
Permalink
Hans, don't declare it manually in every jsp -- just once in your
header portion of your view/jsp templates, which would typically be
included in each individual jsp.



On Jun 27, 2007, at 8:59 AM, Hans Loeblich wrote:

I need to know if there is any way to make UTF-8 my default charset
encoding. Do I really have to set the page contentType at the top of
every jsp? It currently defaults to ISO-8559-1 if I do not explicitly
set it.

Thank you,
Hans Loeblich
Hans Loeblich
2007-06-27 20:25:33 UTC
Permalink
I already have it declared in header include files, but it doesn't do
anything.

I did some searching and found this nugget (from
http://www.oreillynet.com/pub/a/oreilly/java/news/jsptips_1100.html
tip #2):
"The default buffer size is 8KB, more than enough for a typical page,
and you can increase it with the buffer attribute of the page directive.
But if you use the include action in a page, you may be in for a
surprise. Due to limitations in the way the servlet features used by
<jsp:include> are specified, the buffer is always flushed before the
target page is invoked. This means that you can't set headers or use
<jsp:forward> after a <jsp:include> action."

So far it seems to me that setting it manually in every jsp is my only
option, which is quite annoying.

-Hans Loeblich
Post by Yong Bakos
Hans, don't declare it manually in every jsp -- just once in your
header portion of your view/jsp templates, which would typically be
included in each individual jsp.
I need to know if there is any way to make UTF-8 my default charset
encoding. Do I really have to set the page contentType at the top of
every jsp? It currently defaults to ISO-8559-1 if I do not explicitly
set it.
Thank you,
Hans Loeblich
_______________________________________________
resin-interest mailing list
resin-interest at caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest
_______________________________________________
resin-interest mailing list
resin-interest at caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest
Andrea Sodomaco
2007-06-30 08:32:49 UTC
Permalink
I think that your suggestion resolves only a part of the problem.

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>\

How to set globally the pageEncoding to UTF-8?

I have another problem how to set resin parsing of forms POST to UTF-8?

I notice that resin 3.0.23 has problems when a browser POSTs data in
UTF-8 encoding so I need a filter that sets this for each request.

request.setAttribute("caucho.form.character.encoding","UTF-8");

Is this correct? Is any documqntation about this metter?

Thanks.

Andrea Sodomaco

Andrea Sodomaco Consulenze Informatiche
Via Giacometti, 4 - 34146 TRIESTE
Tel.: 040 281648 / 338 3565702 - Fax: 040 46069349
www.sodomaco.it


-----Messaggio originale-----
Da: resin-interest-bounces at caucho.com
[mailto:resin-interest-bounces at caucho.com] Per conto di Yong Bakos
Inviato: mercoled? 27 giugno 2007 18.28
A: General Discussion for the Resin application server
Oggetto: Re: [Resin-interest] How to set default/global response
encoding?



Hans, don't declare it manually in every jsp -- just once in your
header portion of your view/jsp templates, which would typically be
included in each individual jsp.



On Jun 27, 2007, at 8:59 AM, Hans Loeblich wrote:

I need to know if there is any way to make UTF-8 my default charset
encoding. Do I really have to set the page contentType at the top of
every jsp? It currently defaults to ISO-8559-1 if I do not explicitly
set it.

Thank you,
Hans Loeblich


_______________________________________________
resin-interest mailing list
resin-interest at caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest
Knut Forkalsrud
2007-07-01 03:38:30 UTC
Permalink
Post by Andrea Sodomaco
How to set globally the pageEncoding to UTF-8?
I have another problem how to set resin parsing of forms POST to UTF-8?
In Resin 2.1 there was a "character-encoding" attribute. See

http://www.caucho.com/resin-2.1/ref/app-config.xtp#character-encoding



-Knut
Markus Bopp
2007-07-02 16:14:16 UTC
Permalink
Hi everyone,

I am watching Quercus a few months now und and in comparison to other
projects
I realised that some tools are still missing to offer Quercus to a
broader audience.

At the moment, PHP based frameworks (mostly MVC) are spreading all over
the place
and all of them are developed in PHP itself, which may lead to some
problems.

- Each framework has its own opinion about implementing certain things
like sessions, db-abstraction and so on
- Since those frameworks are developed in PHP "natively" they often
have some performance issues
- They are not bound to any standardisation definitions like the JSR

So my idea for my final thesis to come would be to implement an MVC
framework written in Java and
serving Quercus to be usable from within a PHP script.

My question is now, would be such an MVC framwork as extension to
Quercus reasonable?

I'd say yes, since it is not certain that all PHP based MVC frameworks
work with Quercus out of the box.

I'd like to hear your oppinion about that and thank for your patience.


Regards,
--
Markus Bopp

*** Bitte beachten Sie meine neue Festnetznummer! ***

Fussfallstr. 44
D-51109 Koeln

Phone: +49 (0)221 42346894
Mobile: +49 (0)178 3269235

Web: http://www.php-projekte.de
E-Mail: markus.bopp at php-projekte.de

ICQ: 178152063
Skype: koelnkalk
Jabber: TheMuffinMan at jabber.org

USt-IdNr.: DE227436004
Continue reading on narkive:
Loading...