You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Richard Vowles <rv...@sew.co.nz> on 2000/09/05 10:03:02 UTC

Has anyone looked at the J2EE Blueprints example?

The Pet Store?

Its absolutely AWFUL! I mean, it must have taken some serious brain work to
come up with something that bad!

Richard


Re[2]: message tag problems

Posted by Oleg V Alexeev <go...@penza.net>.
Hello Pierre,

Thursday, September 07, 2000, 5:13:44 PM, you wrote:

GC> Seems your database data and your messages use two different charsets.
GC>     database = windows-1251
GC>     message resource = ISO-8859-1

It's right.

...

GC> I'm not an expert in that field, but what don't you use ISO-8859-5 or
GC> KOI8-R, the "natural" charset for russian?

We have MS SQL Server as database and it is not our choice.. 8((

Thank you for your participation, your method (3) is good idea.

-- 
Best regards,
 Oleg                            mailto:gonza@penza.net



Re: message tag problems

Posted by GenePi Conseil <ge...@sympatico.ca>.
Hi Oleg,

Seems your database data and your messages use two different charsets.
    database = windows-1251
    message resource = ISO-8859-1

So, one of them has to do a conversion. Either change it in the database
(1): there's frequently an option to set the data encoding, but generally
you have to dump all data, recreate the database and restore the data. Or do
the conversion in your beans (2). Or else patch the <struts:message> tag to
add a "charset" attribute that would do the conversion from ISO-8859-1 to
windows-1251 (3).

The solution (3) would benefit to other people, but you have to write all
your pages with:

    <!-- Set the charset for the database -->
    <%@ page contentType="text/html;charset=windows-1251" %>

    <!-- Read the message from an ISO-8859-1 file and convert it to
Windows-1251 -->
    <struts:message key="my.message" charset="windows-1251" />

repeating the transcoding to use for each message. The conversion can be
done opening a InputStreamReader and specifying the charset to use.

I'm not an expert in that field, but what don't you use ISO-8859-5 or
KOI8-R, the "natural" charset for russian?

Hope this helps.

Pierre Métras

----- Original Message -----
From: "Oleg V Alexeev" <go...@penza.net>
To: <st...@jakarta.apache.org>
Sent: Thursday, September 07, 2000 5:49 AM
Subject: message tag problems


> Hello friends,
>
>   I have a problem with using <struts:message> tag. English and
>   Russian properties files located in some directiry and
>   <struts:message> work fine with it - prints Russian or English
>   strings according current locale.
>   But when I use in my pages beans for database access I need to
>   insert to my pages such directive as
>
>    <%@ page contentType="text/html;charset=windows-1251" %>
>
>   because of data retrieved from database prints as '?' without this
>   directive. And with this directive <struts:message> prints its
>   messages as '?' too! What is this? How can I break this magic ring?
>
> --
> Best regards,
>  Oleg                            mailto:gonza@penza.net
>
>
>


message tag problems

Posted by Oleg V Alexeev <go...@penza.net>.
Hello friends,

  I have a problem with using <struts:message> tag. English and
  Russian properties files located in some directiry and
  <struts:message> work fine with it - prints Russian or English
  strings according current locale.
  But when I use in my pages beans for database access I need to
  insert to my pages such directive as
  
   <%@ page contentType="text/html;charset=windows-1251" %>

  because of data retrieved from database prints as '?' without this
  directive. And with this directive <struts:message> prints its
  messages as '?' too! What is this? How can I break this magic ring?

-- 
Best regards,
 Oleg                            mailto:gonza@penza.net



Re: Has anyone looked at the J2EE Blueprints example?

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Richard Vowles wrote:

> The Pet Store?
>
> Its absolutely AWFUL! I mean, it must have taken some serious brain work to
> come up with something that bad!
>

As time goes on, you will see that Struts will have a positive influence on
both the PetStore demo and the Blueprints recommendations in general -- we have
the attention of the right people.  Our profile is going up (which IMHO
increases the sense of urgency to complete a good 1.0 release fairly soon).

>
> Richard

Craig

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat