Re: i18n with Japanese characters and tags....

2004-03-26 Thread atchy
Thank you for your assist, Mr. Jason
(B
(BJason Lea [EMAIL PROTECTED] wrote:
(B
(B He was saying it 'can' display Japanese characters. The example doesn't
(B have any Japanese characters in in (if i remember correctly), but if
(B they are put into the properties files for the locale they will be
(B displayed.
(B
(BYep. The example app was written as a good example for i18n, so it does 
(Bnot contain any language specific characters directly in the JSPs to 
(Bshare a JSP with many languages.
(BThe messages resource files contain them.
(B
(B
(B You should look into that http://www.anassina.com/struts/i18n/i18n.html
(B page as it explains a lot.
(B 
(B I think the main problem is you have the Japanese characters already
(B converted into HTML in your application as yuo have them in the format
(B #12495;. When you use a bean to write it out, the bean tried to escape
(B any characters that are significant to HTML, and the '' character is
(B one of them. That is why it replaces your '' with 'amp;'. The bean is
(B trying to help by displaying the text you provided in HTML so that it
(B will appear as #12495; on the page. The 'filter=false' stops it doing
(B this, but also means if you have some other characters like '' in your
(B text then they won't be escaped and could cause the page to be rendered
(B incorrectly.
(B
(Bcarlo,
(BThe behavior of bean:write is correct and proper.
(B
(BWhen you write Japanese in your message resource files, you should not 
(Buse the HTML numeric character 
(Breferences(http://www.w3.org/TR/html401/charset.html#h-5.3.1).
(BOr if you insist on using #x, set filter=false.
(B
(B
(BAs I and Jason said, the most common way is, write Japanese characters 
(Binto message resource files directly (using a text editor and input 
(Bmethod that can handle Japanese) and convert using native2ascii.
(B
(B
(B
(B When I display Japanese characters on my pages I store them in Japanese
(B in a .properties file, then use native2ascii to convert those japanese
(B characters into the Java Unicode properties file format of \u. When
(B java reads them in, the actual unicode character is passed around in
(B java and output directly into the html page. The page encoding is set to
(B UTF-8, and the browser can display it correctly. The bean:write will
(B also still escape the characters that need it such as '' and ''. This
(B also means I am not dealing with HTML formatting inside my Java code,
(B and can happily store the same characters in files, databases etc or
(B output to another device instead of HTML.
(B 
(B -- 
(B Jason Lea
(B 
(B 
(B 
(B carlo latasa wrote:
(B 
(B I just checked the example application and did not see anything on Japanese 
(B characters. I'm at:
(B http://localhost:8080/struts-example/tour.do
(B
(BStruts try to choose language encoding according to your browser setting.
(BSo if you are not in Japanese environment, you should change your 
(Bbrowser language.
(B
(BSee 
(B 5. Test it out using a browser that let's you select default languages: 
(Bof
(B http://www.anassina.com/struts/i18n/i18n.html
(B
(BIn this case, you should choose "Japanese[ja]".
(BThen you will see Japanese characters (if your browser has suitable 
(Bfonts).
(B
(B
(BGood luck!
(B
(B
(B
(BYoshinori Ashizawa
(B
(B
(B 
(B Did you mean that if I were to just take this code and modify it to display 
(B these characters? Or is the example somewhere else?
(B 
(B 
(B   
(B 
(B From: [EMAIL PROTECTED]
(B Reply-To: "Struts Users Mailing List" [EMAIL PROTECTED]
(B To: "Struts Users Mailing List" [EMAIL PROTECTED]
(B Subject: Re: i18n with Japanese characters and tags
(B Date: Tue, 23 Mar 2004 16:12:20 +0900
(B 
(B Carlo,
(B 
(B Have you checked the example application included in Struts1.1(or
(B current CVS)? It can show Japanese characters correctly without any
(B special implementations.
(B I think it will be a help for your problem.
(B 
(B The most frequent mistake in such case is lack of unicode escape
(B to their message resource files.
(B Don't forget "native2ascii" when you make your resource files.
(B 
(B see also : http://www.anassina.com/struts/i18n/i18n.html
(B 
(B 
(B Yoshinori Ashizawa
(B Ja-Jakarta Project  www.jajakarta.org
(B 
(B 
(B carlo latasa" [EMAIL PROTECTED] wrote:
(B 
(B 
(B 
(B Hello,
(B 
(B I'm trying to show Japanese characters on my jsp pages however the ""
(B character of the charset is coming back as amp; which is preventing the
(B characters from being displayed correctly. They look like:
(B $B%-%+%9%O(B
(B 
(B Note, the bean:write tag renders the characters correctly when the 
(B   
(B 
(B filter
(B 
(B 
(B attribute is set to "false".
(B 
(B I've got a struts application using both Tomcat and Jrun and I've set my
(B controller element of the struts-c

Re: i18n with Japanese characters and tags....

2004-03-24 Thread carlo latasa
I just checked the example application and did not see anything on Japanese 
characters. I'm at:
http://localhost:8080/struts-example/tour.do

Did you mean that if I were to just take this code and modify it to display 
these characters? Or is the example somewhere else?


From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: i18n with Japanese characters and tags
Date: Tue, 23 Mar 2004 16:12:20 +0900
Carlo,

Have you checked the example application included in Struts1.1(or
current CVS)? It can show Japanese characters correctly without any
special implementations.
I think it will be a help for your problem.
The most frequent mistake in such case is lack of unicode escape
to their message resource files.
Don't forget native2ascii when you make your resource files.
see also : http://www.anassina.com/struts/i18n/i18n.html


Yoshinori Ashizawa
Ja-Jakarta Project  www.jajakarta.org
carlo latasa [EMAIL PROTECTED] wrote:

 Hello,

 I'm trying to show Japanese characters on my jsp pages however the 
 character of the charset is coming back as amp; which is preventing the
 characters from being displayed correctly. They look like:
 ƒLƒJƒXƒn

 Note, the bean:write tag renders the characters correctly when the 
filter
 attribute is set to false.

 I've got a struts application using both Tomcat and Jrun and I've set my
 controller element of the struts-config.xml as:

 controller contentType=text/html; charset=JISAutoDetect/

 and at the top of a tiles.jsp that's at the head of every page I've got 
a:

 %@ page contentType=html/text; charset=JISAutoDetect %

 head
   META HTTP-EQUIV=Content-Type CONTENT=text/html; 
charset=JISAutoDetect
 %

 . to set the encoding.

 My hunch is that this is something that Struts is doing to the in the
 RequestProcessor or Controller.
 Could/should I write a Filter to override this issue?

 Is this something I chould set in a .css called in the tiles.jsp?

 Any help is much appreciated.


 Carlo Latasa -

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Carlo Latasa - Home: (510) 231-9655 Cell: (415) 385-1567

_
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n with Japanese characters and tags....

2004-03-24 Thread Jason Lea
He was saying it 'can' display Japanese characters. The example doesn't
have any Japanese characters in in (if i remember correctly), but if
they are put into the properties files for the locale they will be
displayed.

You should look into that http://www.anassina.com/struts/i18n/i18n.html
page as it explains a lot.

I think the main problem is you have the Japanese characters already
converted into HTML in your application as yuo have them in the format
#12495;. When you use a bean to write it out, the bean tried to escape
any characters that are significant to HTML, and the '' character is
one of them. That is why it replaces your '' with 'amp;'. The bean is
trying to help by displaying the text you provided in HTML so that it
will appear as #12495; on the page. The 'filter=false' stops it doing
this, but also means if you have some other characters like '' in your
text then they won't be escaped and could cause the page to be rendered
incorrectly.

When I display Japanese characters on my pages I store them in Japanese
in a .properties file, then use native2ascii to convert those japanese
characters into the Java Unicode properties file format of \u. When
java reads them in, the actual unicode character is passed around in
java and output directly into the html page. The page encoding is set to
UTF-8, and the browser can display it correctly. The bean:write will
also still escape the characters that need it such as '' and ''. This
also means I am not dealing with HTML formatting inside my Java code,
and can happily store the same characters in files, databases etc or
output to another device instead of HTML.

-- 
Jason Lea



carlo latasa wrote:

I just checked the example application and did not see anything on Japanese 
characters. I'm at:
http://localhost:8080/struts-example/tour.do

Did you mean that if I were to just take this code and modify it to display 
these characters? Or is the example somewhere else?


  

From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: i18n with Japanese characters and tags
Date: Tue, 23 Mar 2004 16:12:20 +0900

Carlo,

Have you checked the example application included in Struts1.1(or
current CVS)? It can show Japanese characters correctly without any
special implementations.
I think it will be a help for your problem.

The most frequent mistake in such case is lack of unicode escape
to their message resource files.
Don't forget native2ascii when you make your resource files.

see also : http://www.anassina.com/struts/i18n/i18n.html


Yoshinori Ashizawa
Ja-Jakarta Project  www.jajakarta.org


carlo latasa [EMAIL PROTECTED] wrote:



Hello,

I'm trying to show Japanese characters on my jsp pages however the 
character of the charset is coming back as amp; which is preventing the
characters from being displayed correctly. They look like:


Note, the bean:write tag renders the characters correctly when the 
  

filter


attribute is set to false.

I've got a struts application using both Tomcat and Jrun and I've set my
controller element of the struts-config.xml as:

controller contentType=text/html; charset=JISAutoDetect/

and at the top of a tiles.jsp that's at the head of every page I've got 
  

a:


%@ page contentType=html/text; charset=JISAutoDetect %

head
  META HTTP-EQUIV=Content-Type CONTENT=text/html; 
  

charset=JISAutoDetect


%

. to set the encoding.

My hunch is that this is something that Struts is doing to the in the
RequestProcessor or Controller.
Could/should I write a Filter to override this issue?

Is this something I chould set in a .css called in the tiles.jsp?

Any help is much appreciated.


Carlo Latasa -
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






Carlo Latasa - Home: (510) 231-9655 Cell: (415) 385-1567

_
MSN Toolbar provides one-click access to Hotmail from any Web page FREE 
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18n with Japanese characters and tags....

2004-03-24 Thread carlo latasa
Thanks so much Jason!

I'll try that out when I get a chance. I'm fairly sure that was the first 
thing that I tried but I probably forgot something.

Thanks again-


From: Jason Lea [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: i18n with Japanese characters and tags
Date: Thu, 25 Mar 2004 09:39:40 +1200
He was saying it 'can' display Japanese characters. The example doesn't
have any Japanese characters in in (if i remember correctly), but if
they are put into the properties files for the locale they will be
displayed.
You should look into that http://www.anassina.com/struts/i18n/i18n.html
page as it explains a lot.
I think the main problem is you have the Japanese characters already
converted into HTML in your application as yuo have them in the format
#12495;. When you use a bean to write it out, the bean tried to escape
any characters that are significant to HTML, and the '' character is
one of them. That is why it replaces your '' with 'amp;'. The bean is
trying to help by displaying the text you provided in HTML so that it
will appear as #12495; on the page. The 'filter=false' stops it doing
this, but also means if you have some other characters like '' in your
text then they won't be escaped and could cause the page to be rendered
incorrectly.
When I display Japanese characters on my pages I store them in Japanese
in a .properties file, then use native2ascii to convert those japanese
characters into the Java Unicode properties file format of \u. When
java reads them in, the actual unicode character is passed around in
java and output directly into the html page. The page encoding is set to
UTF-8, and the browser can display it correctly. The bean:write will
also still escape the characters that need it such as '' and ''. This
also means I am not dealing with HTML formatting inside my Java code,
and can happily store the same characters in files, databases etc or
output to another device instead of HTML.
--
Jason Lea


carlo latasa wrote:

I just checked the example application and did not see anything on 
Japanese
characters. I'm at:
http://localhost:8080/struts-example/tour.do

Did you mean that if I were to just take this code and modify it to 
display
these characters? Or is the example somewhere else?




From: [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: i18n with Japanese characters and tags
Date: Tue, 23 Mar 2004 16:12:20 +0900

Carlo,

Have you checked the example application included in Struts1.1(or
current CVS)? It can show Japanese characters correctly without any
special implementations.
I think it will be a help for your problem.

The most frequent mistake in such case is lack of unicode escape
to their message resource files.
Don't forget native2ascii when you make your resource files.

see also : http://www.anassina.com/struts/i18n/i18n.html


Yoshinori Ashizawa
Ja-Jakarta Project  www.jajakarta.org


carlo latasa [EMAIL PROTECTED] wrote:



Hello,

I'm trying to show Japanese characters on my jsp pages however the 
character of the charset is coming back as amp; which is preventing 
the
characters from being displayed correctly. They look like:
ƒLƒJƒXƒn

Note, the bean:write tag renders the characters correctly when the


filter


attribute is set to false.

I've got a struts application using both Tomcat and Jrun and I've set 
my
controller element of the struts-config.xml as:

controller contentType=text/html; charset=JISAutoDetect/

and at the top of a tiles.jsp that's at the head of every page I've got


a:


%@ page contentType=html/text; charset=JISAutoDetect %

head
  META HTTP-EQUIV=Content-Type CONTENT=text/html;


charset=JISAutoDetect


%

. to set the encoding.

My hunch is that this is something that Struts is doing to the in the
RequestProcessor or Controller.
Could/should I write a Filter to override this issue?

Is this something I chould set in a .css called in the tiles.jsp?

Any help is much appreciated.


Carlo Latasa -


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






Carlo Latasa - Home: (510) 231-9655 Cell: (415) 385-1567

_
MSN Toolbar provides one-click access to Hotmail from any Web page EFREE
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Carlo Latasa - Home: (510) 231-9655 Cell: (415) 385-1567

RE: i18n with Japanese characters and tags....

2004-03-22 Thread Kumar, Ram S
Hi,
Try
 %
response.setContentType(text/html;charset=JISAutoDetect);
or
response.setContentType(text/html;charset=UTF-8);
%
 in your jsp pages.

Ram Kumar

-Original Message-
From: carlo latasa [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 23, 2004 11:33 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: i18n with Japanese characters and tags

Hello,

I'm trying to show Japanese characters on my jsp pages however the  
character of the charset is coming back as amp; which is preventing the 
characters from being displayed correctly. They look like: 
#12461;#12459;#12473;#12495;

Note, the bean:write tag renders the characters correctly when the filter 
attribute is set to false.

I've got a struts application using both Tomcat and Jrun and I've set my 
controller element of the struts-config.xml as:

controller contentType=text/html; charset=JISAutoDetect/

and at the top of a tiles.jsp that's at the head of every page I've got a:

%@ page contentType=html/text; charset=JISAutoDetect %

head
  META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=JISAutoDetect

%

. to set the encoding.

My hunch is that this is something that Struts is doing to the in the 
RequestProcessor or Controller.
Could/should I write a Filter to override this issue?

Is this something I chould set in a .css called in the tiles.jsp?

Any help is much appreciated.


Carlo Latasa -

_
Find a broadband plan that fits. Great local deals on high-speed Internet 
access. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: i18n with Japanese characters and tags....

2004-03-22 Thread carlo latasa
thanks for the message Ram,

I did try that and it had no noticable effect.


From: Kumar, Ram S [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: i18n with Japanese characters and tags
Date: Tue, 23 Mar 2004 00:47:08 -0600
Hi,
Try
 %
response.setContentType(text/html;charset=JISAutoDetect);
or
response.setContentType(text/html;charset=UTF-8);
%
 in your jsp pages.
Ram Kumar

-Original Message-
From: carlo latasa [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 23, 2004 11:33 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: i18n with Japanese characters and tags
Hello,

I'm trying to show Japanese characters on my jsp pages however the 
character of the charset is coming back as amp; which is preventing the
characters from being displayed correctly. They look like:
ƒLƒJƒXƒn
Note, the bean:write tag renders the characters correctly when the filter
attribute is set to false.
I've got a struts application using both Tomcat and Jrun and I've set my
controller element of the struts-config.xml as:
controller contentType=text/html; charset=JISAutoDetect/

and at the top of a tiles.jsp that's at the head of every page I've got a:

%@ page contentType=html/text; charset=JISAutoDetect %

head
  META HTTP-EQUIV=Content-Type CONTENT=text/html; 
charset=JISAutoDetect

%

. to set the encoding.

My hunch is that this is something that Struts is doing to the in the
RequestProcessor or Controller.
Could/should I write a Filter to override this issue?
Is this something I chould set in a .css called in the tiles.jsp?

Any help is much appreciated.

Carlo Latasa -

_
Find a broadband plan that fits. Great local deals on high-speed Internet
access. http://click.atdmt.com/AVE/go/onm00200360ave/direct/01/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Carlo Latasa - Home: (510) 231-9655 Cell: (415) 385-1567

_
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE 
download! http://clk.atdmt.com/AVE/go/onm00200413ave/direct/01/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n with Japanese characters and tags....

2004-03-22 Thread atchy
Carlo,

Have you checked the example application included in Struts1.1(or 
current CVS)? It can show Japanese characters correctly without any 
special implementations.
I think it will be a help for your problem.

The most frequent mistake in such case is lack of unicode escape 
to their message resource files.
Don't forget native2ascii when you make your resource files.

see also : http://www.anassina.com/struts/i18n/i18n.html


Yoshinori Ashizawa
Ja-Jakarta Project  www.jajakarta.org


carlo latasa [EMAIL PROTECTED] wrote:

 Hello,
 
 I'm trying to show Japanese characters on my jsp pages however the  
 character of the charset is coming back as amp; which is preventing the 
 characters from being displayed correctly. They look like: 
 #12461;#12459;#12473;#12495;
 
 Note, the bean:write tag renders the characters correctly when the filter 
 attribute is set to false.
 
 I've got a struts application using both Tomcat and Jrun and I've set my 
 controller element of the struts-config.xml as:
 
 controller contentType=text/html; charset=JISAutoDetect/
 
 and at the top of a tiles.jsp that's at the head of every page I've got a:
 
 %@ page contentType=html/text; charset=JISAutoDetect %
 
 head
   META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=JISAutoDetect 
 %
 
 . to set the encoding.
 
 My hunch is that this is something that Struts is doing to the in the 
 RequestProcessor or Controller.
 Could/should I write a Filter to override this issue?
 
 Is this something I chould set in a .css called in the tiles.jsp?
 
 Any help is much appreciated.
 
 
 Carlo Latasa -


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: I18N, Tiles definition

2003-12-09 Thread List Mailbox
Try this.

tiles:importAttribute name=title/
titlebean:message name=title scope=page//title

Not sure of the JSTL way maybe:

tiles:importAttribute name=title/
title fmt:message key=${title}/title


Cal
www.calandva.com

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Behalf Of Oliver Wulff
Sent: Tuesday, December 09, 2003 4:46 AM
To: [EMAIL PROTECTED]
Subject: I18N, Tiles definition




I've defined a tile called title in a tile definition which is a language
dependend string. Therefore, I though I could set the key (webapp.title) of
the resource bundle as a value:
definition name=.mainLayout path=/layout/classicLayout.jsp
put name=title  value=webapp.title /
put name=header value=/top_menu.jsp /
put name=menu   value=/toc.jsp /
put name=footer value=/footer.jsp /
put name=body   value=/welcome.jsp /
  /definition

I tried to read it in the classicLayout.jsp like this:
fmt:message key=tiles:insert attribute=title//

but it doesn't work.
Can't I easily use the keys of a resource bundle for language dependend
strings in the tile definition?
I have no solution to solve my problem.


Regards
Oliver






*** BITTE BEACHTEN ***
Diese Nachricht (wie auch allfällige Anhänge dazu) beinhaltet
möglicherweise vertrauliche oder gesetzlich geschützte Daten oder
Informationen. Zum Empfang derselben ist (sind) ausschliesslich die
genannte(n) Person(en) bestimmt. Falls Sie diese Nachricht
irrtümlicherweise erreicht hat, sind Sie höflich gebeten, diese unter
Ausschluss jeder Reproduktion zu zerstören und die absendende Person
umgehend zu benachrichtigen. Vielen Dank für Ihre Hilfe.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: i18N tag lib and struts

2003-11-03 Thread Vara Prasad Reddy
meaning, do I need to use i18N tag lib at all, when using struts.

-Original Message-
From: Vara Prasad Reddy [mailto:[EMAIL PROTECTED]
Sent: Monday, November 03, 2003 6:39 PM
To: Struts Users Mailing List
Subject: i18N tag lib and struts


Hello everybody:

How best is i18N taglib useful, along with struts 1.1

- Vara Prasad

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18n - Chinese charactor problem

2003-10-20 Thread Adam Hardy


Hi Zyd,
I am using the same version as you and that code works for me. I just 
ran it. Are you trying it in a new database? Perhaps in an old database 
in an old version it won't work.

BTW if this doesn't resolve it, perhaps you should email me off-list or 
go the [EMAIL PROTECTED] since it's completely off-topic for struts now.

Adam

On 10/19/2003 04:01 PM ZYD wrote:
It's said version4.1 supports unicode, my MySQL version: 4.1.0-alpha-max-nt,  but I cannot execute the following:

CREATE TABLE unicodetable ( myrow VARCHAR(200) )
   CHARACTER SET UTF8;
ERROR 1115: Unknown character set: 'UTF8'

connection url is:
drivers=org.gjt.mm.mysql.Driver
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=UTF-8
mysql-connector-java-3.0.9-stable-bin.jar is in F:\Program Files\Apache Group\Tomcat 4.1\common\lib

When I write chinese charactor to MySQL, it's not working properly.

- Original Message - 
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, October 20, 2003 12:09 AM
Subject: Re: i18n - Chinese charactor problem



What version of mySQL do you have? I believe that complete unicode 
support is only present in the latest perhaps even beta versions.

Adam

On 10/18/2003 07:43 PM ZYD wrote:

No, UTF-8 does not work.

- Original Message - 
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 4:49 PM
Subject: Re: i18n - Chinese charactor problem




UTF-8

On 10/16/2003 07:25 PM ZYD wrote:


Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.

I have another problem, hope can get some advice from you:

I used the following url to connect to MySQL:
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=GB2312
use GB2312 in this string is not a good idea I think. 

Then what should the characterEncoding be?

-bruce

- Original Message - 
From: Jason Lea [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 11:34 AM
Subject: Re: i18n - Chinese charactor problem





If you are using UTF-8 everywhere it should work - I use it for english 
 Japanese and it works.
You mentioned in another message you had this:

filter-classSetCharacterEncodingFilter/filter-class
init-param
param-nameencoding/param-name
param-valueGB2312/param-value
Are you still using that?  or UTF-8?
Everything has to match.
ZYD wrote:




Hi Jason,

Thank you for your response.

I did exactly the same thing as the article said, but still, not working properly.

Chinese can be displayed, but not in the text box.  

If I change %@ page contentType=text/html; charset=UTF-8 % to
%@ page contentType=text/html; charset=GBK % 
then the Chinese charactors are handled properly.

Why is that?

- Original Message - 
From: Jason Lea [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 5:51 AM
Subject: Re: i18n - Chinese charactor problem







Here is a link that explains what is needed and a filter to do it...

http://www.anassina.com/struts/i18n/i18n.html

Greg Reddin wrote:






I don't remember the exact code, but a looong time ago we had to write 
a Filter that created a request wrapper that properly set the 
character encoding on request parameters.  Maybe googling that would 
turn up something.

Greg

ZYD wrote:

  




Hi,
I have a problem in getting the Chinese charactors from html:text,
The following is my jsp file:
%@ page contentType=text/html;charset=UTF-8 language=java %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html
html:form action=/submit focus=email
head/head
body
html:text property=email/
html:submitbean:message key=button.logon//html:submit
/body
/html:form
/html:html
-
I have two property files, one is for englisn, the other is for 
chinese. Both english and chinese can be displayed properly on the 
page, except in the text box.

When I input chinese charactors in the text box and submit, I cannot 
get the chinese charactor in the form bean correctly. The chinese 
charactors become some unreadable charactors like .

There are no special process in the getEmail and setEmail method in 
the form bean.

Does anybody have similar problem? I need your advice.
Any response is appreciated.


--
--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n - Chinese charactor problem

2003-10-19 Thread Adam Hardy
What version of mySQL do you have? I believe that complete unicode 
support is only present in the latest perhaps even beta versions.

Adam

On 10/18/2003 07:43 PM ZYD wrote:
No, UTF-8 does not work.

- Original Message - 
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 4:49 PM
Subject: Re: i18n - Chinese charactor problem



UTF-8

On 10/16/2003 07:25 PM ZYD wrote:

Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.

I have another problem, hope can get some advice from you:

I used the following url to connect to MySQL:
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=GB2312
use GB2312 in this string is not a good idea I think. 

Then what should the characterEncoding be?

-bruce

- Original Message - 
From: Jason Lea [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 11:34 AM
Subject: Re: i18n - Chinese charactor problem




If you are using UTF-8 everywhere it should work - I use it for english 
 Japanese and it works.
You mentioned in another message you had this:

filter-classSetCharacterEncodingFilter/filter-class
init-param
param-nameencoding/param-name
param-valueGB2312/param-value
Are you still using that?  or UTF-8?
Everything has to match.
ZYD wrote:



Hi Jason,

Thank you for your response.

I did exactly the same thing as the article said, but still, not working properly.

Chinese can be displayed, but not in the text box.  

If I change %@ page contentType=text/html; charset=UTF-8 % to
%@ page contentType=text/html; charset=GBK % 
then the Chinese charactors are handled properly.

Why is that?

- Original Message - 
From: Jason Lea [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 5:51 AM
Subject: Re: i18n - Chinese charactor problem






Here is a link that explains what is needed and a filter to do it...

http://www.anassina.com/struts/i18n/i18n.html

Greg Reddin wrote:

 



I don't remember the exact code, but a looong time ago we had to write 
a Filter that created a request wrapper that properly set the 
character encoding on request parameters.  Maybe googling that would 
turn up something.

Greg

ZYD wrote:

   



Hi,
I have a problem in getting the Chinese charactors from html:text,
The following is my jsp file:
%@ page contentType=text/html;charset=UTF-8 language=java %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html
html:form action=/submit focus=email
head/head
body
html:text property=email/
html:submitbean:message key=button.logon//html:submit
/body
/html:form
/html:html
-
I have two property files, one is for englisn, the other is for 
chinese. Both english and chinese can be displayed properly on the 
page, except in the text box.

When I input chinese charactors in the text box and submit, I cannot 
get the chinese charactor in the form bean correctly. The chinese 
charactors become some unreadable charactors like .

There are no special process in the getEmail and setEmail method in 
the form bean.

Does anybody have similar problem? I need your advice.
Any response is appreciated.


--
--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n - Chinese charactor problem

2003-10-19 Thread Jim Theodoridis
Wich jdbc driver for mySQL are U using?

It works fine to me mysql-connector-java-3.0.8 for Greeks


- Original Message -
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Sunday, October 19, 2003 7:09 PM
Subject: Re: i18n - Chinese charactor problem


 What version of mySQL do you have? I believe that complete unicode
 support is only present in the latest perhaps even beta versions.

 Adam

 On 10/18/2003 07:43 PM ZYD wrote:
  No, UTF-8 does not work.
 
  - Original Message -
  From: Adam Hardy [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, October 17, 2003 4:49 PM
  Subject: Re: i18n - Chinese charactor problem
 
 
 
 UTF-8
 
 On 10/16/2003 07:25 PM ZYD wrote:
 
 Now I use UTF-8 everywhere instead of gb2312, this problem is gone.
Thanks for your help.
 
 I have another problem, hope can get some advice from you:
 
 I used the following url to connect to MySQL:

mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUn
icode=truecharacterEncoding=GB2312
 
 use GB2312 in this string is not a good idea I think.
 
 Then what should the characterEncoding be?
 
 -bruce
 
 - Original Message -
 From: Jason Lea [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, October 17, 2003 11:34 AM
 Subject: Re: i18n - Chinese charactor problem
 
 
 
 
 If you are using UTF-8 everywhere it should work - I use it for
english
  Japanese and it works.
 You mentioned in another message you had this:
 
 filter-classSetCharacterEncodingFilter/filter-class
 init-param
 param-nameencoding/param-name
 param-valueGB2312/param-value
 
 Are you still using that?  or UTF-8?
 Everything has to match.
 
 
 ZYD wrote:
 
 
 
 Hi Jason,
 
 Thank you for your response.
 
 I did exactly the same thing as the article said, but still, not
working properly.
 
 Chinese can be displayed, but not in the text box.
 
 If I change %@ page contentType=text/html; charset=UTF-8 % to
 %@ page contentType=text/html; charset=GBK %
 then the Chinese charactors are handled properly.
 
 Why is that?
 
 - Original Message -
 From: Jason Lea [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, October 17, 2003 5:51 AM
 Subject: Re: i18n - Chinese charactor problem
 
 
 
 
 
 
 Here is a link that explains what is needed and a filter to do it...
 
 http://www.anassina.com/struts/i18n/i18n.html
 
 
 Greg Reddin wrote:
 
 
 
 
 
 I don't remember the exact code, but a looong time ago we had to
write
 a Filter that created a request wrapper that properly set the
 character encoding on request parameters.  Maybe googling that
would
 turn up something.
 
 Greg
 
 ZYD wrote:
 
 
 
 
 
 Hi,
 I have a problem in getting the Chinese charactors from
html:text,
 The following is my jsp file:
 %@ page contentType=text/html;charset=UTF-8 language=java %
 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
 
 html:html
 html:form action=/submit focus=email
 head/head
 body
 html:text property=email/
 
 html:submitbean:message key=button.logon//html:submit
 /body
 /html:form
 /html:html
 -
 I have two property files, one is for englisn, the other is for
 chinese. Both english and chinese can be displayed properly on the
 page, except in the text box.
 
 When I input chinese charactors in the text box and submit, I
cannot
 get the chinese charactor in the form bean correctly. The chinese
 charactors become some unreadable charactors like .
 
 There are no special process in the getEmail and setEmail method
in
 the form bean.
 
 Does anybody have similar problem? I need your advice.
 Any response is appreciated.


 --
 --
 struts 1.1 + tomcat 5.0.12 + java 1.4.2
 Linux 2.4.20 RH9


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18n - Chinese charactor problem

2003-10-19 Thread ZYD

MySQL version: 4.1.0-alpha-max-nt, 

connection url is:

drivers=org.gjt.mm.mysql.Driver
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=UTF-8

mysql-connector-java-3.0.9-stable-bin.jar is in F:\Program Files\Apache Group\Tomcat 
4.1\common\lib

When I write chinese charactor to MySQL, it's not working properly.

- Original Message - 
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, October 20, 2003 12:09 AM
Subject: Re: i18n - Chinese charactor problem


 What version of mySQL do you have? I believe that complete unicode 
 support is only present in the latest perhaps even beta versions.
 
 Adam
 
 On 10/18/2003 07:43 PM ZYD wrote:
  No, UTF-8 does not work.
  
  - Original Message - 
  From: Adam Hardy [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, October 17, 2003 4:49 PM
  Subject: Re: i18n - Chinese charactor problem
  
  
  
 UTF-8
 
 On 10/16/2003 07:25 PM ZYD wrote:
 
 Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for 
 your help.
 
 I have another problem, hope can get some advice from you:
 
 I used the following url to connect to MySQL:
 mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=GB2312
 
 use GB2312 in this string is not a good idea I think. 
 
 Then what should the characterEncoding be?
 
 -bruce
 
 - Original Message - 
 From: Jason Lea [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, October 17, 2003 11:34 AM
 Subject: Re: i18n - Chinese charactor problem
 
 
 
 
 If you are using UTF-8 everywhere it should work - I use it for english 
  Japanese and it works.
 You mentioned in another message you had this:
 
 filter-classSetCharacterEncodingFilter/filter-class
 init-param
 param-nameencoding/param-name
 param-valueGB2312/param-value
 
 Are you still using that?  or UTF-8?
 Everything has to match.
 
 
 ZYD wrote:
 
 
 
 Hi Jason,
 
 Thank you for your response.
 
 I did exactly the same thing as the article said, but still, not working 
 properly.
 
 Chinese can be displayed, but not in the text box.  
 
 If I change %@ page contentType=text/html; charset=UTF-8 % to
 %@ page contentType=text/html; charset=GBK % 
 then the Chinese charactors are handled properly.
 
 Why is that?
 
 - Original Message - 
 From: Jason Lea [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, October 17, 2003 5:51 AM
 Subject: Re: i18n - Chinese charactor problem
 
 
 
 
 
 
 Here is a link that explains what is needed and a filter to do it...
 
 http://www.anassina.com/struts/i18n/i18n.html
 
 
 Greg Reddin wrote:
 
   
 
 
 
 I don't remember the exact code, but a looong time ago we had to write 
 a Filter that created a request wrapper that properly set the 
 character encoding on request parameters.  Maybe googling that would 
 turn up something.
 
 Greg
 
 ZYD wrote:
 
 
 
 
 
 Hi,
 I have a problem in getting the Chinese charactors from html:text,
 The following is my jsp file:
 %@ page contentType=text/html;charset=UTF-8 language=java %
 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
 
 html:html
 html:form action=/submit focus=email
 head/head
 body
 html:text property=email/
 
 html:submitbean:message key=button.logon//html:submit
 /body
 /html:form
 /html:html
 -
 I have two property files, one is for englisn, the other is for 
 chinese. Both english and chinese can be displayed properly on the 
 page, except in the text box.
 
 When I input chinese charactors in the text box and submit, I cannot 
 get the chinese charactor in the form bean correctly. The chinese 
 charactors become some unreadable charactors like .
 
 There are no special process in the getEmail and setEmail method in 
 the form bean.
 
 Does anybody have similar problem? I need your advice.
 Any response is appreciated.
 
 
 -- 
 --
 struts 1.1 + tomcat 5.0.12 + java 1.4.2
 Linux 2.4.20 RH9
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Re: i18n - Chinese charactor problem

2003-10-19 Thread ZYD
I use mysql-connector-java-3.0.9-stable-bin.jar, it is in F:\Program Files\Apache 
Group\Tomcat 4.1\common\lib

MySQL version: 4.1.0-alpha-max-nt, 

connection url is:

drivers=org.gjt.mm.mysql.Driver
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=UTF-8

Not works fine.


- Original Message - 
From: Jim Theodoridis [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, October 20, 2003 12:27 AM
Subject: Re: i18n - Chinese charactor problem


 Wich jdbc driver for mySQL are U using?
 
 It works fine to me mysql-connector-java-3.0.8 for Greeks
 
 
 - Original Message -
 From: Adam Hardy [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Sunday, October 19, 2003 7:09 PM
 Subject: Re: i18n - Chinese charactor problem
 
 
  What version of mySQL do you have? I believe that complete unicode
  support is only present in the latest perhaps even beta versions.
 
  Adam
 
  On 10/18/2003 07:43 PM ZYD wrote:
   No, UTF-8 does not work.
  
   - Original Message -
   From: Adam Hardy [EMAIL PROTECTED]
   To: Struts Users Mailing List [EMAIL PROTECTED]
   Sent: Friday, October 17, 2003 4:49 PM
   Subject: Re: i18n - Chinese charactor problem
  
  
  
  UTF-8
  
  On 10/16/2003 07:25 PM ZYD wrote:
  
  Now I use UTF-8 everywhere instead of gb2312, this problem is gone.
 Thanks for your help.
  
  I have another problem, hope can get some advice from you:
  
  I used the following url to connect to MySQL:
 
 mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUn
 icode=truecharacterEncoding=GB2312
  
  use GB2312 in this string is not a good idea I think.
  
  Then what should the characterEncoding be?
  
  -bruce
  
  - Original Message -
  From: Jason Lea [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, October 17, 2003 11:34 AM
  Subject: Re: i18n - Chinese charactor problem
  
  
  
  
  If you are using UTF-8 everywhere it should work - I use it for
 english
   Japanese and it works.
  You mentioned in another message you had this:
  
  filter-classSetCharacterEncodingFilter/filter-class
  init-param
  param-nameencoding/param-name
  param-valueGB2312/param-value
  
  Are you still using that?  or UTF-8?
  Everything has to match.
  
  
  ZYD wrote:
  
  
  
  Hi Jason,
  
  Thank you for your response.
  
  I did exactly the same thing as the article said, but still, not
 working properly.
  
  Chinese can be displayed, but not in the text box.
  
  If I change %@ page contentType=text/html; charset=UTF-8 % to
  %@ page contentType=text/html; charset=GBK %
  then the Chinese charactors are handled properly.
  
  Why is that?
  
  - Original Message -
  From: Jason Lea [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, October 17, 2003 5:51 AM
  Subject: Re: i18n - Chinese charactor problem
  
  
  
  
  
  
  Here is a link that explains what is needed and a filter to do it...
  
  http://www.anassina.com/struts/i18n/i18n.html
  
  
  Greg Reddin wrote:
  
  
  
  
  
  I don't remember the exact code, but a looong time ago we had to
 write
  a Filter that created a request wrapper that properly set the
  character encoding on request parameters.  Maybe googling that
 would
  turn up something.
  
  Greg
  
  ZYD wrote:
  
  
  
  
  
  Hi,
  I have a problem in getting the Chinese charactors from
 html:text,
  The following is my jsp file:
  %@ page contentType=text/html;charset=UTF-8 language=java %
  %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
  
  html:html
  html:form action=/submit focus=email
  head/head
  body
  html:text property=email/
  
  html:submitbean:message key=button.logon//html:submit
  /body
  /html:form
  /html:html
  -
  I have two property files, one is for englisn, the other is for
  chinese. Both english and chinese can be displayed properly on the
  page, except in the text box.
  
  When I input chinese charactors in the text box and submit, I
 cannot
  get the chinese charactor in the form bean correctly. The chinese
  charactors become some unreadable charactors like .
  
  There are no special process in the getEmail and setEmail method
 in
  the form bean.
  
  Does anybody have similar problem? I need your advice.
  Any response is appreciated.
 
 
  --
  --
  struts 1.1 + tomcat 5.0.12 + java 1.4.2
  Linux 2.4.20 RH9
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Re: i18n - Chinese charactor problem

2003-10-19 Thread ZYD
It's said version4.1 supports unicode, my MySQL version: 4.1.0-alpha-max-nt,  but I 
cannot execute the following:

CREATE TABLE unicodetable ( myrow VARCHAR(200) )
   CHARACTER SET UTF8;

ERROR 1115: Unknown character set: 'UTF8'

connection url is:
drivers=org.gjt.mm.mysql.Driver
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=UTF-8

mysql-connector-java-3.0.9-stable-bin.jar is in F:\Program Files\Apache Group\Tomcat 
4.1\common\lib

When I write chinese charactor to MySQL, it's not working properly.


- Original Message - 
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Monday, October 20, 2003 12:09 AM
Subject: Re: i18n - Chinese charactor problem


 What version of mySQL do you have? I believe that complete unicode 
 support is only present in the latest perhaps even beta versions.
 
 Adam
 
 On 10/18/2003 07:43 PM ZYD wrote:
  No, UTF-8 does not work.
  
  - Original Message - 
  From: Adam Hardy [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, October 17, 2003 4:49 PM
  Subject: Re: i18n - Chinese charactor problem
  
  
  
 UTF-8
 
 On 10/16/2003 07:25 PM ZYD wrote:
 
 Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for 
 your help.
 
 I have another problem, hope can get some advice from you:
 
 I used the following url to connect to MySQL:
 mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=GB2312
 
 use GB2312 in this string is not a good idea I think. 
 
 Then what should the characterEncoding be?
 
 -bruce
 
 - Original Message - 
 From: Jason Lea [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, October 17, 2003 11:34 AM
 Subject: Re: i18n - Chinese charactor problem
 
 
 
 
 If you are using UTF-8 everywhere it should work - I use it for english 
  Japanese and it works.
 You mentioned in another message you had this:
 
 filter-classSetCharacterEncodingFilter/filter-class
 init-param
 param-nameencoding/param-name
 param-valueGB2312/param-value
 
 Are you still using that?  or UTF-8?
 Everything has to match.
 
 
 ZYD wrote:
 
 
 
 Hi Jason,
 
 Thank you for your response.
 
 I did exactly the same thing as the article said, but still, not working 
 properly.
 
 Chinese can be displayed, but not in the text box.  
 
 If I change %@ page contentType=text/html; charset=UTF-8 % to
 %@ page contentType=text/html; charset=GBK % 
 then the Chinese charactors are handled properly.
 
 Why is that?
 
 - Original Message - 
 From: Jason Lea [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, October 17, 2003 5:51 AM
 Subject: Re: i18n - Chinese charactor problem
 
 
 
 
 
 
 Here is a link that explains what is needed and a filter to do it...
 
 http://www.anassina.com/struts/i18n/i18n.html
 
 
 Greg Reddin wrote:
 
   
 
 
 
 I don't remember the exact code, but a looong time ago we had to write 
 a Filter that created a request wrapper that properly set the 
 character encoding on request parameters.  Maybe googling that would 
 turn up something.
 
 Greg
 
 ZYD wrote:
 
 
 
 
 
 Hi,
 I have a problem in getting the Chinese charactors from html:text,
 The following is my jsp file:
 %@ page contentType=text/html;charset=UTF-8 language=java %
 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
 
 html:html
 html:form action=/submit focus=email
 head/head
 body
 html:text property=email/
 
 html:submitbean:message key=button.logon//html:submit
 /body
 /html:form
 /html:html
 -
 I have two property files, one is for englisn, the other is for 
 chinese. Both english and chinese can be displayed properly on the 
 page, except in the text box.
 
 When I input chinese charactors in the text box and submit, I cannot 
 get the chinese charactor in the form bean correctly. The chinese 
 charactors become some unreadable charactors like .
 
 There are no special process in the getEmail and setEmail method in 
 the form bean.
 
 Does anybody have similar problem? I need your advice.
 Any response is appreciated.
 
 
 -- 
 --
 struts 1.1 + tomcat 5.0.12 + java 1.4.2
 Linux 2.4.20 RH9
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Re: i18n - Chinese charactor problem

2003-10-18 Thread ZYD
No, UTF-8 does not work.

- Original Message - 
From: Adam Hardy [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 4:49 PM
Subject: Re: i18n - Chinese charactor problem


 UTF-8
 
 On 10/16/2003 07:25 PM ZYD wrote:
  Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for 
  your help.
  
  I have another problem, hope can get some advice from you:
  
  I used the following url to connect to MySQL:
  mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=GB2312
  
  use GB2312 in this string is not a good idea I think. 
  
  Then what should the characterEncoding be?
  
  -bruce
  
  - Original Message - 
  From: Jason Lea [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Sent: Friday, October 17, 2003 11:34 AM
  Subject: Re: i18n - Chinese charactor problem
  
  
  
 If you are using UTF-8 everywhere it should work - I use it for english 
  Japanese and it works.
 You mentioned in another message you had this:
 
 filter-classSetCharacterEncodingFilter/filter-class
 init-param
 param-nameencoding/param-name
 param-valueGB2312/param-value
 
 Are you still using that?  or UTF-8?
 Everything has to match.
 
 
 ZYD wrote:
 
 
 Hi Jason,
 
 Thank you for your response.
 
 I did exactly the same thing as the article said, but still, not working properly.
 
 Chinese can be displayed, but not in the text box.  
 
 If I change %@ page contentType=text/html; charset=UTF-8 % to
 %@ page contentType=text/html; charset=GBK % 
 then the Chinese charactors are handled properly.
 
 Why is that?
 
 - Original Message - 
 From: Jason Lea [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, October 17, 2003 5:51 AM
 Subject: Re: i18n - Chinese charactor problem
 
 
  
 
 
 Here is a link that explains what is needed and a filter to do it...
 
 http://www.anassina.com/struts/i18n/i18n.html
 
 
 Greg Reddin wrote:
 

 
 
 I don't remember the exact code, but a looong time ago we had to write 
 a Filter that created a request wrapper that properly set the 
 character encoding on request parameters.  Maybe googling that would 
 turn up something.
 
 Greg
 
 ZYD wrote:
 
  
 
 
 Hi,
 I have a problem in getting the Chinese charactors from html:text,
 The following is my jsp file:
 %@ page contentType=text/html;charset=UTF-8 language=java %
 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
 
 html:html
 html:form action=/submit focus=email
 head/head
 body
  html:text property=email/
 
  html:submitbean:message key=button.logon//html:submit
 /body
 /html:form
 /html:html
 -
 I have two property files, one is for englisn, the other is for 
 chinese. Both english and chinese can be displayed properly on the 
 page, except in the text box.
 
 When I input chinese charactors in the text box and submit, I cannot 
 get the chinese charactor in the form bean correctly. The chinese 
 charactors become some unreadable charactors like .
 
 There are no special process in the getEmail and setEmail method in 
 the form bean.
 
 Does anybody have similar problem? I need your advice.
 Any response is appreciated.
 
 
 -- 
 struts 1.1 + tomcat 5.0.12 + java 1.4.2
 Linux 2.4.20 RH9
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Re: i18n - Chinese charactor problem

2003-10-17 Thread Adam Hardy
UTF-8

On 10/16/2003 07:25 PM ZYD wrote:
Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your help.

I have another problem, hope can get some advice from you:

I used the following url to connect to MySQL:
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=GB2312
use GB2312 in this string is not a good idea I think. 

Then what should the characterEncoding be?

-bruce

- Original Message - 
From: Jason Lea [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 11:34 AM
Subject: Re: i18n - Chinese charactor problem



If you are using UTF-8 everywhere it should work - I use it for english 
 Japanese and it works.
You mentioned in another message you had this:

filter-classSetCharacterEncodingFilter/filter-class
init-param
param-nameencoding/param-name
param-valueGB2312/param-value
Are you still using that?  or UTF-8?
Everything has to match.
ZYD wrote:


Hi Jason,

Thank you for your response.

I did exactly the same thing as the article said, but still, not working properly.

Chinese can be displayed, but not in the text box.  

If I change %@ page contentType=text/html; charset=UTF-8 % to
%@ page contentType=text/html; charset=GBK % 
then the Chinese charactors are handled properly.

Why is that?

- Original Message - 
From: Jason Lea [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 5:51 AM
Subject: Re: i18n - Chinese charactor problem





Here is a link that explains what is needed and a filter to do it...

http://www.anassina.com/struts/i18n/i18n.html

Greg Reddin wrote:

  


I don't remember the exact code, but a looong time ago we had to write 
a Filter that created a request wrapper that properly set the 
character encoding on request parameters.  Maybe googling that would 
turn up something.

Greg

ZYD wrote:




Hi,
I have a problem in getting the Chinese charactors from html:text,
The following is my jsp file:
%@ page contentType=text/html;charset=UTF-8 language=java %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html
html:form action=/submit focus=email
head/head
body
html:text property=email/
html:submitbean:message key=button.logon//html:submit
/body
/html:form
/html:html
-
I have two property files, one is for englisn, the other is for 
chinese. Both english and chinese can be displayed properly on the 
page, except in the text box.

When I input chinese charactors in the text box and submit, I cannot 
get the chinese charactor in the form bean correctly. The chinese 
charactors become some unreadable charactors like .

There are no special process in the getEmail and setEmail method in 
the form bean.

Does anybody have similar problem? I need your advice.
Any response is appreciated.


--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n - Chinese charactor problem

2003-10-16 Thread Greg Reddin
I don't remember the exact code, but a looong time ago we had to write a 
Filter that created a request wrapper that properly set the character 
encoding on request parameters.  Maybe googling that would turn up 
something.

Greg

ZYD wrote:
Hi, 

I have a problem in getting the Chinese charactors from html:text, 

The following is my jsp file: 

%@ page contentType=text/html;charset=UTF-8 language=java %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html
html:form action=/submit focus=email
 head/head
 body
  html:text property=email/
  html:submitbean:message key=button.logon//html:submit
 /body
/html:form
/html:html
-
I have two property files, one is for englisn, the other is for chinese. 
Both english and chinese can be displayed properly on the page, except in the text box.

When I input chinese charactors in the text box and submit, I cannot get the chinese charactor in the form bean correctly. The chinese charactors become some unreadable charactors like .

There are no special process in the getEmail and setEmail method in the form bean.

Does anybody have similar problem? I need your advice.
Any response is appreciated.
--bruce


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n - Chinese charactor problem

2003-10-16 Thread Jason Lea
Here is a link that explains what is needed and a filter to do it...

http://www.anassina.com/struts/i18n/i18n.html

Greg Reddin wrote:

I don't remember the exact code, but a looong time ago we had to write 
a Filter that created a request wrapper that properly set the 
character encoding on request parameters.  Maybe googling that would 
turn up something.

Greg

ZYD wrote:

Hi,
I have a problem in getting the Chinese charactors from html:text,
The following is my jsp file:
%@ page contentType=text/html;charset=UTF-8 language=java %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html
html:form action=/submit focus=email
 head/head
 body
  html:text property=email/
  html:submitbean:message key=button.logon//html:submit
 /body
/html:form
/html:html
-
I have two property files, one is for englisn, the other is for 
chinese. Both english and chinese can be displayed properly on the 
page, except in the text box.

When I input chinese charactors in the text box and submit, I cannot 
get the chinese charactor in the form bean correctly. The chinese 
charactors become some unreadable charactors like .

There are no special process in the getEmail and setEmail method in 
the form bean.

Does anybody have similar problem? I need your advice.
Any response is appreciated.
--bruce


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Jason Lea


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n - Chinese charactor problem

2003-10-16 Thread ZYD
Hi Greg, 

Thank you for your fast response.

I do write a filter to set the encoding to GB2312, but if I set the encoding to gb2312 
on every page, because this disallow my pages to accept other language charactors, 
right? Can I set the encoding dynamicly according to user's locale?

This is my filter in my web.xml

filter
filter-nameSet Character Encoding/filter-name
filter-classSetCharacterEncodingFilter/filter-class
init-param
param-nameencoding/param-name
param-valueGB2312/param-value
/init-param
init-param
param-nameignore/param-name
param-valuetrue/param-value
/init-param
/filter
filter-mapping
filter-nameSet Character Encoding/filter-name
servlet-nameaction/servlet-name
/filter-mapping

Thanks again.

--bruce

- Original Message - 
From: Greg Reddin [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 2:48 AM
Subject: Re: i18n - Chinese charactor problem


 I don't remember the exact code, but a looong time ago we had to write a 
 Filter that created a request wrapper that properly set the character 
 encoding on request parameters.  Maybe googling that would turn up 
 something.
 
 Greg
 
 ZYD wrote:
  Hi, 
  
  I have a problem in getting the Chinese charactors from html:text, 
  
  The following is my jsp file: 
  
  %@ page contentType=text/html;charset=UTF-8 language=java %
  %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
  
  html:html
  html:form action=/submit focus=email
   head/head
   body
html:text property=email/
  
html:submitbean:message key=button.logon//html:submit
   /body
  /html:form
  /html:html
  -
  I have two property files, one is for englisn, the other is for chinese. 
  Both english and chinese can be displayed properly on the page, except in the text 
  box.
  
  When I input chinese charactors in the text box and submit, I cannot get the 
  chinese charactor in the form bean correctly. The chinese charactors become some 
  unreadable charactors like .
  
  There are no special process in the getEmail and setEmail method in the form bean.
  
  Does anybody have similar problem? I need your advice.
  Any response is appreciated.
  
  --bruce
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Re: i18n - Chinese charactor problem

2003-10-16 Thread ZYD
Hi Jason,

Thank you for your response.

I did exactly the same thing as the article said, but still, not working properly.

Chinese can be displayed, but not in the text box.  

If I change %@ page contentType=text/html; charset=UTF-8 % to
%@ page contentType=text/html; charset=GBK % 
then the Chinese charactors are handled properly.

Why is that?

- Original Message - 
From: Jason Lea [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 5:51 AM
Subject: Re: i18n - Chinese charactor problem


 Here is a link that explains what is needed and a filter to do it...
 
 http://www.anassina.com/struts/i18n/i18n.html
 
 
 Greg Reddin wrote:
 
  I don't remember the exact code, but a looong time ago we had to write 
  a Filter that created a request wrapper that properly set the 
  character encoding on request parameters.  Maybe googling that would 
  turn up something.
 
  Greg
 
  ZYD wrote:
 
  Hi,
  I have a problem in getting the Chinese charactors from html:text,
  The following is my jsp file:
  %@ page contentType=text/html;charset=UTF-8 language=java %
  %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
 
  html:html
  html:form action=/submit focus=email
   head/head
   body
html:text property=email/
 
html:submitbean:message key=button.logon//html:submit
   /body
  /html:form
  /html:html
  -
  I have two property files, one is for englisn, the other is for 
  chinese. Both english and chinese can be displayed properly on the 
  page, except in the text box.
 
  When I input chinese charactors in the text box and submit, I cannot 
  get the chinese charactor in the form bean correctly. The chinese 
  charactors become some unreadable charactors like .
 
  There are no special process in the getEmail and setEmail method in 
  the form bean.
 
  Does anybody have similar problem? I need your advice.
  Any response is appreciated.
 
  --bruce
 
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 -- 
 Jason Lea
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Re: i18n - Chinese charactor problem

2003-10-16 Thread Jason Lea
If you are using UTF-8 everywhere it should work - I use it for english 
 Japanese and it works.
You mentioned in another message you had this:

filter-classSetCharacterEncodingFilter/filter-class
init-param
param-nameencoding/param-name
param-valueGB2312/param-value
Are you still using that?  or UTF-8?
Everything has to match.
ZYD wrote:

Hi Jason,

Thank you for your response.

I did exactly the same thing as the article said, but still, not working properly.

Chinese can be displayed, but not in the text box.  

If I change %@ page contentType=text/html; charset=UTF-8 % to
%@ page contentType=text/html; charset=GBK % 
then the Chinese charactors are handled properly.

Why is that?

- Original Message - 
From: Jason Lea [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 5:51 AM
Subject: Re: i18n - Chinese charactor problem

 

Here is a link that explains what is needed and a filter to do it...

http://www.anassina.com/struts/i18n/i18n.html

Greg Reddin wrote:

   

I don't remember the exact code, but a looong time ago we had to write 
a Filter that created a request wrapper that properly set the 
character encoding on request parameters.  Maybe googling that would 
turn up something.

Greg

ZYD wrote:

 

Hi,
I have a problem in getting the Chinese charactors from html:text,
The following is my jsp file:
%@ page contentType=text/html;charset=UTF-8 language=java %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html
html:form action=/submit focus=email
head/head
body
 html:text property=email/
 html:submitbean:message key=button.logon//html:submit
/body
/html:form
/html:html
-
I have two property files, one is for englisn, the other is for 
chinese. Both english and chinese can be displayed properly on the 
page, except in the text box.

When I input chinese charactors in the text box and submit, I cannot 
get the chinese charactor in the form bean correctly. The chinese 
charactors become some unreadable charactors like .

There are no special process in the getEmail and setEmail method in 
the form bean.

Does anybody have similar problem? I need your advice.
Any response is appreciated.
--bruce
   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

--
Jason Lea


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   



--
Jason Lea


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n - Chinese charactor problem

2003-10-16 Thread ZYD

Now I use UTF-8 everywhere instead of gb2312, this problem is gone. Thanks for your 
help.

I have another problem, hope can get some advice from you:

I used the following url to connect to MySQL:
mysql.url=jdbc:mysql://localhost:3306/CoderPool?user=rootpassword=useUnicode=truecharacterEncoding=GB2312

use GB2312 in this string is not a good idea I think. 

Then what should the characterEncoding be?

-bruce

- Original Message - 
From: Jason Lea [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Friday, October 17, 2003 11:34 AM
Subject: Re: i18n - Chinese charactor problem


 If you are using UTF-8 everywhere it should work - I use it for english 
  Japanese and it works.
 You mentioned in another message you had this:
 
 filter-classSetCharacterEncodingFilter/filter-class
 init-param
 param-nameencoding/param-name
 param-valueGB2312/param-value
 
 Are you still using that?  or UTF-8?
 Everything has to match.
 
 
 ZYD wrote:
 
 Hi Jason,
 
 Thank you for your response.
 
 I did exactly the same thing as the article said, but still, not working properly.
 
 Chinese can be displayed, but not in the text box.  
 
 If I change %@ page contentType=text/html; charset=UTF-8 % to
 %@ page contentType=text/html; charset=GBK % 
 then the Chinese charactors are handled properly.
 
 Why is that?
 
 - Original Message - 
 From: Jason Lea [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, October 17, 2003 5:51 AM
 Subject: Re: i18n - Chinese charactor problem
 
 
   
 
 Here is a link that explains what is needed and a filter to do it...
 
 http://www.anassina.com/struts/i18n/i18n.html
 
 
 Greg Reddin wrote:
 
 
 
 I don't remember the exact code, but a looong time ago we had to write 
 a Filter that created a request wrapper that properly set the 
 character encoding on request parameters.  Maybe googling that would 
 turn up something.
 
 Greg
 
 ZYD wrote:
 
   
 
 Hi,
 I have a problem in getting the Chinese charactors from html:text,
 The following is my jsp file:
 %@ page contentType=text/html;charset=UTF-8 language=java %
 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
 
 html:html
 html:form action=/submit focus=email
  head/head
  body
   html:text property=email/
 
   html:submitbean:message key=button.logon//html:submit
  /body
 /html:form
 /html:html
 -
 I have two property files, one is for englisn, the other is for 
 chinese. Both english and chinese can be displayed properly on the 
 page, except in the text box.
 
 When I input chinese charactors in the text box and submit, I cannot 
 get the chinese charactor in the form bean correctly. The chinese 
 charactors become some unreadable charactors like .
 
 There are no special process in the getEmail and setEmail method in 
 the form bean.
 
 Does anybody have similar problem? I need your advice.
 Any response is appreciated.
 
 --bruce
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
   
 
 -- 
 Jason Lea
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 
 -- 
 Jason Lea
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

Re: i18n with struts / JSTL

2003-09-09 Thread Adam Hardy
It's not necessarily a question of which is best, rather which has the 
biggest future. In this respect you should use the JSTL fmt: taglib.

Adam

On 09/09/2003 08:18 AM Siva wrote:
Dear Friends,

Could anyone suggests which is best among the

Struts tags   and
JSTL tags
for I18n of struts based application.

Thanks,
Sivakumar
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: i18n with struts / JSTL

2003-09-09 Thread Paul McCulloch
Bear in mind that there are bugs in the jstl code that aren't in the struts
equivalents:

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16932

My approach has been to use the jstl tag and hope that the bug is fixed
before I have to release!

Paul

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED]
Sent: 09 September 2003 09:27
To: Struts Users Mailing List
Subject: Re: i18n with struts / JSTL


It's not necessarily a question of which is best, rather which has the 
biggest future. In this respect you should use the JSTL fmt: taglib.


Adam

On 09/09/2003 08:18 AM Siva wrote:
 Dear Friends,
 
 Could anyone suggests which is best among the
 
 Struts tags   and
 JSTL tags
 
 for I18n of struts based application.
 
 Thanks,
 Sivakumar
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 

-- 
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: i18n with struts / JSTL

2003-09-09 Thread Paananen, Tero
 Bear in mind that there are bugs in the jstl code that aren't 
 in the struts
 equivalents:
 
 http://nagoya.apache.org/bugzilla/show_bug.cgi?id=16932

That's just one implementation of JSTL.

The application server vendor's JSTL implementation
is not going to have (the same) bugs. Depending, of
course, if you're using an app server that provides
its own JSTL implementation.

-TPP

-
This email may contain confidential and privileged material for the sole use of the 
intended recipient(s). Any review, use, retention, distribution or disclosure by 
others is strictly prohibited. If you are not the intended recipient (or authorized to 
receive for the recipient), please contact the sender by reply email and delete all 
copies of this message.  Also, email is susceptible to data corruption, interception, 
tampering, unauthorized amendment and viruses. We only send and receive emails on the 
basis that we are not liable for any such corruption, interception, tampering, 
amendment or viruses or any consequence thereof.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: I18N - Currency question

2003-08-09 Thread David Geary
On Friday, August 8, 2003, at 08:08 AM, David Thielen wrote:

Hi;

I am displaying currency in my website. It is always in U.S. dollars 
so I am doing:
NumberFormat.getCurrencyInstance().format( (float) price / 100f );

Two questions:
  1.. I assume I should set the locale for this to en_US since I want 
to have the dollar sign.
If your website supports only US English, or if that's the default, 
then sure.

  2.. Should it do the commas and periods to the user's locale - or is 
everyone used to dollars using the US comma/period setup.
If you're supporting other locales, I'd format accordingly. If I was 
selling something, I'd be as accommodating as possible. 8-)

If you're using JSP for presentation, I recommend the JSTL i18n and 
formatting tags instead of Java code.

david

thanks - dave


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n, passing variable into arg0 using bean:message

2003-06-24 Thread Tin Pham
On thing that wasn't mentioned.

You have to cast to (String) in the scriptlets example as define does not
set a type.

bean:message key=deleteBusiness.confirm.p1 arg0=%=(String)orgName%/


Jason Lea [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Tin Pham wrote:
  Hi,
 
  Individually these all work
 
  deleteBusiness.confirm.p1 = Confirm company b{0}/b is correct.
 
  bean:message key=deleteBusiness.confirm.p1 arg0=Esso/
 
  bean:write name=deleteOganizationForm property=organizationName
  scope=session ignore=true/
 
  Instead of using a literal of esso we want to use the value taken from
our
  formBean, deleteOganizationForm.
 
  We have tried various combinations. Can somebody please provide an
example?

 You are unable to use a bean inside the arg0= parameter (as you have
 no doubt found out).

 You probably have 2 choices here:

 1. Use JSTL (preferred)
 You would have to use the struts-el tags in the contrib directory
 It should look something like this

 bean:message key=deleteBusiness.confirm.p1
 arg0=${deleteOganizationForm.organizationName}/



 2. Use Scriptlets

 bean:define id=orgName name=deleteOganizationForm
 property=organizationName /

 bean:message key=deleteBusiness.confirm.p1 arg0=%=orgName%/

 -- 
 Jason Lea




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18n, passing variable into arg0 using bean:message

2003-06-20 Thread Tin Pham
Thanks! I really appreciate your help.

I guess JSTL will eventually replace struts custom tags?

Jason Lea [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Tin Pham wrote:
  Hi,
 
  Individually these all work
 
  deleteBusiness.confirm.p1 = Confirm company b{0}/b is correct.
 
  bean:message key=deleteBusiness.confirm.p1 arg0=Esso/
 
  bean:write name=deleteOganizationForm property=organizationName
  scope=session ignore=true/
 
  Instead of using a literal of esso we want to use the value taken from
our
  formBean, deleteOganizationForm.
 
  We have tried various combinations. Can somebody please provide an
example?

 You are unable to use a bean inside the arg0= parameter (as you have
 no doubt found out).

 You probably have 2 choices here:

 1. Use JSTL (preferred)
 You would have to use the struts-el tags in the contrib directory
 It should look something like this

 bean:message key=deleteBusiness.confirm.p1
 arg0=${deleteOganizationForm.organizationName}/



 2. Use Scriptlets

 bean:define id=orgName name=deleteOganizationForm
 property=organizationName /

 bean:message key=deleteBusiness.confirm.p1 arg0=%=orgName%/

 -- 
 Jason Lea




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18n, passing variable into arg0 using bean:message

2003-06-20 Thread Craig R. McClanahan


On Fri, 20 Jun 2003, Tin Pham wrote:

 Date: Fri, 20 Jun 2003 02:15:39 -0400
 From: Tin Pham [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: i18n, passing variable into arg0 using bean:message

 Thanks! I really appreciate your help.

 I guess JSTL will eventually replace struts custom tags?

The Struts logic tags will *not* go away (that would break backwards
compatibility), but I would recommend that you use JSTL (perhaps in
conjunction with the struts-el library to allow the use of EL expressions
in Struts-like tags) for new development.

Craig McClanahan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18n, passing variable into arg0 using bean:message

2003-06-19 Thread Jason Lea
Tin Pham wrote:
Hi,

Individually these all work

deleteBusiness.confirm.p1 = Confirm company b{0}/b is correct.

bean:message key=deleteBusiness.confirm.p1 arg0=Esso/

bean:write name=deleteOganizationForm property=organizationName
scope=session ignore=true/
Instead of using a literal of esso we want to use the value taken from our
formBean, deleteOganizationForm.
We have tried various combinations. Can somebody please provide an example?
You are unable to use a bean inside the arg0= parameter (as you have 
no doubt found out).

You probably have 2 choices here:

1. Use JSTL (preferred)
You would have to use the struts-el tags in the contrib directory
It should look something like this
bean:message key=deleteBusiness.confirm.p1 
arg0=${deleteOganizationForm.organizationName}/



2. Use Scriptlets

bean:define id=orgName name=deleteOganizationForm 
property=organizationName /

bean:message key=deleteBusiness.confirm.p1 arg0=%=orgName%/

--
Jason Lea
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: i18n, passing variable into arg0 using bean:message

2003-06-19 Thread Hrishi Dixit

This could be one way:

bean:define id=orgName name=deleteOganizationForm property=organizationName 
scope=session ignore=true/
bean:message key=deleteBusiness.confirm.p1 arg0=%= orgName % /

..Hrishi

--
__

 Hrishi Dixit
 Finaplex
 415-490-2236 work
 415-297-2722 cell
 [EMAIL PROTECTED]

 -Original Message-
 From: Tin Pham [mailto:[EMAIL PROTECTED]
 Sent: Thursday, June 19, 2003 6:04 AM
 To: [EMAIL PROTECTED]
 Subject: i18n, passing variable into arg0 using bean:message
 
 
 Hi,
 
 Individually these all work
 
 deleteBusiness.confirm.p1 = Confirm company b{0}/b is correct.
 
 bean:message key=deleteBusiness.confirm.p1 arg0=Esso/
 
 bean:write name=deleteOganizationForm property=organizationName
 scope=session ignore=true/
 
 Instead of using a literal of esso we want to use the value 
 taken from our
 formBean, deleteOganizationForm.
 
 We have tried various combinations. Can somebody please 
 provide an example?
 
 
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: i18n in SimpleMenuItem

2003-03-03 Thread Cedric Dumoulin
 Hi,

 The Tiles config files should contain the resource keys (put 
name=title value=a.key /). You use this keys in the jsp file in 
conjunction with tags accepting such keys:
tiles:importAttribute /
bean:write name=a.key /.

 You can implement your own SmartMenuItem, taking a key as input, and 
providing the translated value as output ... You should find a way to 
specify the resource bundle to use.

   Cedric

Dan Allen wrote:

Has anyone written a class (which they would like to share) that
extends SimpleMenuItem to retrieve the bundle key for value and
global forward for the link?
I was envisioning something along the lines of:

item name=webapp.page.news value=news
classname=org.apache.struts.titles.bean.SmartMenuItem/
I am not even interested in the global forward as much as the
bean:message bundle resource.
Also, while I am on the topic of tiles.  Is there any way to use the
bean:message key=webapp.title/ in the tiles definition file?  I
know that you can have different definition files for different
languages, but it would seem to be more logical to be able to
reference the application message bundle instead.  It would seem to
me a new type of message would be the most approrpriate if it is
not already possible to do this.
I would be grateful for any responses to those two inquires.

Dan

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: i18n in SimpleMenuItem

2003-02-28 Thread David Graham
I don't see any attributes in tiles-config.dtd that allow message keys.  
This would probably be a useful enhancement though.  Feel free to enter an 
enhancement request (unless it turns out it's already supported).

David



From: Dan Allen [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: i18n in SimpleMenuItem
Date: Fri, 28 Feb 2003 21:03:36 -0600
Has anyone written a class (which they would like to share) that
extends SimpleMenuItem to retrieve the bundle key for value and
global forward for the link?
I was envisioning something along the lines of:

item name=webapp.page.news value=news
classname=org.apache.struts.titles.bean.SmartMenuItem/
I am not even interested in the global forward as much as the
bean:message bundle resource.
Also, while I am on the topic of tiles.  Is there any way to use the
bean:message key=webapp.title/ in the tiles definition file?  I
know that you can have different definition files for different
languages, but it would seem to be more logical to be able to
reference the application message bundle instead.  It would seem to
me a new type of message would be the most approrpriate if it is
not already possible to do this.
I would be grateful for any responses to those two inquires.

Dan

--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Daniel Allen, [EMAIL PROTECTED]
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I'm old enough to know better, but still too young to care.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: i18n: property file content not display correctly

2003-01-17 Thread Mark Galbreath
I don't think you can't get the special characters French requires from
UTF-8, dude.  You may have to use one of the ISO character set encodings.
 
Mark

-Original Message-
From: dmz [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 11:22 AM


 I am trying to display my page in French. I have set encoding to utf-8
for JSP and HTML and also edited the property file so that it is encoded in
utf-8. But some characters are not displayed correctly even the encoding
under view in IE6 shows utf-8 when auto-select is on. I am attaching part of
the property file so you could check its encoding. Has anyone run into this
problem before? What should I do?




RE: i18n: property file content not display correctly

2003-01-17 Thread Pani, Gourav
go for ISO-8859 encoding instead. ISO-8859-1 works fine for us for French.

-Original Message-
From: Mark Galbreath [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 11:28 AM
To: 'Struts Users Mailing List'
Subject: RE: i18n: property file content not display correctly


I don't think you can't get the special characters French requires from
UTF-8, dude.  You may have to use one of the ISO character set encodings.
 
Mark

-Original Message-
From: dmz [mailto:[EMAIL PROTECTED]] 
Sent: Friday, January 17, 2003 11:22 AM


 I am trying to display my page in French. I have set encoding to utf-8
for JSP and HTML and also edited the property file so that it is encoded in
utf-8. But some characters are not displayed correctly even the encoding
under view in IE6 shows utf-8 when auto-select is on. I am attaching part of
the property file so you could check its encoding. Has anyone run into this
problem before? What should I do?


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: I18N Issues and Best Practices

2002-12-12 Thread Eddie Bush
You're using run-time expressions.  They aren't quite as evil as 
scriplets, but I don't blame you for wanting to stay away from them. 
Have you learned of the JSTL yet?  That's certainly one way to go. 
Also, you may want to look into the struts-el contributed taglib.  The 
struts-el taglib gives you struts-specific tags (for places you need 
them) which have the power of the JSTL Expression Language (typically 
called the EL, which is where struts-el gets it's name).

http://jakarta.apache.org/taglibs -- look for the JSTL or the standard 
taglib.

--
Eddie Bush





--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



RE: I18N Issues and Best Practices

2002-12-12 Thread Karr, David
Note that rtexprvalues have to be the ENTIRE attribute value, not just a
portion, so your examples like header-%=countryCode% can't work like
that.  If you still wanted to use rtexprvalues, you'd have to use
something like '% header- + countryCode %'.

A cleaner solution is probably to use the JSTL and Struts-EL.
Referencing bean values in the EL is much easier than referencing
rtexprvalues.  For some simple examples in your case:

   html-el:form action=action-${countryCode}.do

   html-el:option value=${x.y}

   html-el:img src=img/${regionCode}/picture.gif

Struts-EL is normally in the Struts nightly build, but the last few days
we've had an unknown problem that is preventing it from going into the
distribution.

 -Original Message-
 From: Paul Hodgetts, Agile Logic [mailto:[EMAIL PROTECTED]]
 
 I've been working on a site that is intended to be fully
 I18N.  It's the first site I've tried where I'm really
 going for a full and clean separation of the layout from
 the content, so please forgive any rookie questions.
 
 I've looked into getting strings into resource files and
 also the ways that struts and tiles can choose layouts
 based on the country/language as well.  I think I can
 figure these out with a little reading and experimenting.
 
 One issue that's got me stumped is how to deal with some
 of the finer-grained things on the page.  For example,
 when the path and/or name of a graphic file needs to be
 dynamically constructed, or the page name for a link, or
 the value for a select option.
 
 I find in these areas that the only solution I can get
 to work is to embed a piece of scriptlet into the struts
 or html tag.  It doesn't seem to be able to parse an
 embedded tag that is stuck in the middle of attribute
 definition of another tag.
 
 Here's a couple of examples:
 
 * A div where the class name is built with some dynamic
 data:
div class=header-%=countryCode%
 
 * A struts html:form tag where the action URL is built
 using dynamic data:
html:form action=action-%=countryCode%.do
 
 * A select option where the value comes from a bean:
html:option value=bean:write name=x property=y/
html:option value=%=x.getY()%
 
 * An image where the source needs a path dynamically
generated:
  html:img src=img/%=regionCode%/picture.gif
 
 Anyway, hopefully that gives you the idea of the types
 of issues I'm having trouble with.
 
 I'd really appreciate any tips or pointers to references
 on how to get the rest of the scriptlet code out of the
 page, in a way that supports i18n of the content.  I've
 been looking a bit at custom tags, but I don't quite see
 how to use them to solve these issues yet.
 
 Thanks in advance for any help,
 Paul
 
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: I18N Issues and Best Practices

2002-12-12 Thread Eddie Bush
Karr, David wrote:


Note that rtexprvalues have to be the ENTIRE attribute value,


Man ... I always forget that until I fudge up and have to go back ...


not just a
portion, so your examples like header-%=countryCode% can't work like
that.  If you still wanted to use rtexprvalues, you'd have to use
something like '% header- + countryCode %'.


... he means %= header= + countryCode % :-)


A cleaner solution is probably to use the JSTL and Struts-EL.
Referencing bean values in the EL is much easier than referencing
rtexprvalues.  For some simple examples in your case:

  html-el:form action=action-${countryCode}.do

  html-el:option value=${x.y}

  html-el:img src=img/${regionCode}/picture.gif

Struts-EL is normally in the Struts nightly build, but the last few days
we've had an unknown problem that is preventing it from going into the
distribution.


I had to change some things in the struts-el build file to get it to 
build, but, even after I got that going, it still didn't place a copy of 
struts-el.jar into ${struts.home}/target/library.  Was that the intent?

--
Eddie Bush





--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



Re: I18N Issues and Best Practices

2002-12-12 Thread Paul Hodgetts, Agile Logic
Thank you Eddie and David!  struts-el looks like just the
type of thing I was looking for.  I wasn't aware there was
something available that had the expression evaluation.
Now if I can only find some documentation on it...  ;-)

Thanks again,
Paul


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: I18N Issues and Best Practices

2002-12-12 Thread Karr, David
The most important documentation is the JSTL specification.  Struts-EL
is very simple.  It just uses the JSTL EL engine for evaluating
attribute values.  You can get information about the JSTL specification
at http://java.sun.com/products/jsp/jstl/.

 -Original Message-
 From: Paul Hodgetts, Agile Logic [mailto:[EMAIL PROTECTED]]
 
 Thank you Eddie and David!  struts-el looks like just the
 type of thing I was looking for.  I wasn't aware there was
 something available that had the expression evaluation.
 Now if I can only find some documentation on it...  ;-)

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n implementation

2002-12-06 Thread Craig R. McClanahan


On Fri, 6 Dec 2002, Eric Tse wrote:

 Date: Fri, 6 Dec 2002 12:07:59 +0800
 From: Eric Tse [EMAIL PROTECTED]
 Reply-To: Eric Tse [EMAIL PROTECTED]
 To: Craig R. McClanahan [EMAIL PROTECTED]
 Cc: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: i18n implementation

 Hi Craig,

 Thanks for your email! I have just tried your latest nighty build and it is
 what I want to have!! Thanks a lot!!

 I have one more question. Where or which setting do bean:message
 key=index.logon/ in index.jsp detects it is in Japanese locale? I
 observed that the Locale is set to ja when I access index.jsp and
 corresponding ApplicationResources_ja.properties is loaded. Since I need to
 make a language selection screen at index.jsp, does it mean i need to
 hardcode the English message instead of specifiying any bean:message /
 ?


Struts stores the user's selected Locale as a session attribute under the
key Action.LOCALE_KEY.  If there's no such attribute already, it chooses
based on the user's preferred language (which is sent in the
Accept-Languages HTTP header).

To create your own language chooser, simply set up a simple form with just
a select box listing the languages you support, and submit to an Action
that reads the specified selection, creates a corresponding Locale, and
stores it in the session attribute under the specified key.  This
selection will hold until the user changes it, or until the session
expires or is timed out.

 Thanks a lot.

 Regards,
 Eric

Craig



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n implementation

2002-12-06 Thread David Graham
You might look at the tag I posted to bugzilla as an example.  Feel free to 
hack it to suit your needs.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12648

David






From: Craig R. McClanahan [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Eric Tse [EMAIL PROTECTED]
CC: Struts Users Mailing List [EMAIL PROTECTED]
Subject: Re: i18n implementation
Date: Fri, 6 Dec 2002 18:34:03 -0800 (PST)



On Fri, 6 Dec 2002, Eric Tse wrote:

 Date: Fri, 6 Dec 2002 12:07:59 +0800
 From: Eric Tse [EMAIL PROTECTED]
 Reply-To: Eric Tse [EMAIL PROTECTED]
 To: Craig R. McClanahan [EMAIL PROTECTED]
 Cc: Struts Users Mailing List [EMAIL PROTECTED]
 Subject: Re: i18n implementation

 Hi Craig,

 Thanks for your email! I have just tried your latest nighty build and it 
is
 what I want to have!! Thanks a lot!!

 I have one more question. Where or which setting do bean:message
 key=index.logon/ in index.jsp detects it is in Japanese locale? I
 observed that the Locale is set to ja when I access index.jsp and
 corresponding ApplicationResources_ja.properties is loaded. Since I need 
to
 make a language selection screen at index.jsp, does it mean i need to
 hardcode the English message instead of specifiying any bean:message 
/
 ?


Struts stores the user's selected Locale as a session attribute under the
key Action.LOCALE_KEY.  If there's no such attribute already, it chooses
based on the user's preferred language (which is sent in the
Accept-Languages HTTP header).

To create your own language chooser, simply set up a simple form with just
a select box listing the languages you support, and submit to an Action
that reads the specified selection, creates a corresponding Locale, and
stores it in the session attribute under the specified key.  This
selection will hold until the user changes it, or until the session
expires or is timed out.

 Thanks a lot.

 Regards,
 Eric

Craig



--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]


_
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



Re: i18n implementation

2002-12-05 Thread Craig R. McClanahan


On Thu, 5 Dec 2002, Eric Tse wrote:

 Date: Thu, 5 Dec 2002 16:02:35 +0800
 From: Eric Tse [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED],
  Eric Tse [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: i18n implementation

 Dear all,

 I am designing the framework of an enterprise application which serves 3
 large groups of user. And of each group has 3 GUI language selections. I
 am now trying to generalize the functions so as to reuse most of the
 codes and deploy as a single application with different context-param,
 i.e. each group has its JAR.

 For the language issue, I do not want the web designer to copy and
 paste those JSP into 3 sets to make 3 distinct GUI webpages. (ie. 3 x 3
 = 9 JARs)

 Do you have any recommendation in producing 3 GUI languages? Do I really
 necessary to create 3 JARs with different web.xml to load the
 .properties files?

 Any recommendation is welcome!


If you mean that each page of the application needs to be visible in
multiple languages, that is what tags like bean:message is for.  Indeed,
my need to do this a few years ago (but in twelve languages) was one of
the early motivations that drove the me to create Struts.

As an example of this in action, load the struts-example.war (recent
nightly build) into your favorite server and change your browser's
language preference to Japanese, then access the app.  Same exact pages --
but the prompts and error messages are displayed in a different language.

The example app doesn't have a choose your language switcher control,
but that would be quite easy to add.  All you'd need is an Action that
stored the corresponding Locale in the user's session under the key
represented by the Action.LOCALE_KEY string.

 ---
 Eric Tse
 SCP, SCWCD

Craig




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n implementation

2002-12-05 Thread Eric Tse
Hi Craig,

Thanks for your email! I have just tried your latest nighty build and it is
what I want to have!! Thanks a lot!!

I have one more question. Where or which setting do bean:message
key=index.logon/ in index.jsp detects it is in Japanese locale? I
observed that the Locale is set to ja when I access index.jsp and
corresponding ApplicationResources_ja.properties is loaded. Since I need to
make a language selection screen at index.jsp, does it mean i need to
hardcode the English message instead of specifiying any bean:message /
?

Thanks a lot.

Regards,
Eric

- Original Message -
From: Craig R. McClanahan [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]; Eric Tse
[EMAIL PROTECTED]
Sent: Friday, December 06, 2002 10:54 AM
Subject: Re: i18n implementation




  --
  From: Craig R. McClanahan[SMTP:[EMAIL PROTECTED]]
  Sent: Friday, December 06, 2002 10:54:21 AM
  To: Struts Users Mailing List; Eric Tse
  Subject: Re: i18n implementation
  Auto forwarded by a Rule
 
 
 
 On Thu, 5 Dec 2002, Eric Tse wrote:

  Date: Thu, 5 Dec 2002 16:02:35 +0800
  From: Eric Tse [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED],
   Eric Tse [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Subject: i18n implementation
 
  Dear all,
 
  I am designing the framework of an enterprise application which serves 3
  large groups of user. And of each group has 3 GUI language selections. I
  am now trying to generalize the functions so as to reuse most of the
  codes and deploy as a single application with different context-param,
  i.e. each group has its JAR.
 
  For the language issue, I do not want the web designer to copy and
  paste those JSP into 3 sets to make 3 distinct GUI webpages. (ie. 3 x 3
  = 9 JARs)
 
  Do you have any recommendation in producing 3 GUI languages? Do I really
  necessary to create 3 JARs with different web.xml to load the
  .properties files?
 
  Any recommendation is welcome!
 

 If you mean that each page of the application needs to be visible in
 multiple languages, that is what tags like bean:message is for.  Indeed,
 my need to do this a few years ago (but in twelve languages) was one of
 the early motivations that drove the me to create Struts.

 As an example of this in action, load the struts-example.war (recent
 nightly build) into your favorite server and change your browser's
 language preference to Japanese, then access the app.  Same exact pages --
 but the prompts and error messages are displayed in a different language.

 The example app doesn't have a choose your language switcher control,
 but that would be quite easy to add.  All you'd need is an Action that
 stored the corresponding Locale in the user's session under the key
 represented by the Action.LOCALE_KEY string.

  ---
  Eric Tse
  SCP, SCWCD

 Craig




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n, resource bundles, bean:message/...

2002-11-24 Thread Antoni Reus
Hi, take a look at

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11852


A Divendres 22 Novembre 2002 21:16, Joshua McCulloch va escriure:
 That shouldn't be any different than
 bean:message key=submit.price arg0=1234.56/

 I forgot to mention the exception occuring with that
 statement. It looks like the magic happening in the
 java.text.* classes with a {0,number,currency}
 argument requires a java.lang.Number.

 org.apache.jasper.JasperException: Cannot format given
 Object as a Number
   at
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:
248) at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)


 ...etc...

 root cause

 java.lang.IllegalArgumentException: Cannot format
 given Object as a Number
   at
 java.text.NumberFormat.format(NumberFormat.java:204)
   at java.text.Format.format(Format.java:116)
   at
 java.text.MessageFormat.format(MessageFormat.java:737)
   at
 java.text.MessageFormat.format(MessageFormat.java:486)
   at java.text.Format.format(Format.java:116)

 --- James Mitchell [EMAIL PROTECTED] wrote:
   it won't compile, its expecting a
 
  java.lang.String:
 
  try this...
 
   bean:message key=submit.price
 arg0=%= new
  Double(1234.56).toString() %/
 
 
 
  --
  James Mitchell
  Software Engineer/Struts Evangelist
  http://www.open-tools.org
 
  If you were plowing a field, which would you rather
  use? Two strong oxen or
  1024 chickens?
  - Seymour Cray (1925-1996), father of supercomputing
 
   -Original Message-
   From: Joshua McCulloch
 
  [mailto:[EMAIL PROTECTED]]
 
   Sent: Friday, November 22, 2002 2:43 PM
   To: [EMAIL PROTECTED]
   Subject: i18n, resource bundles,
 
  bean:message/...
 
   Can someone please help me understand how to use
   arguments for bean:message/ ?
  
   I have an ApplicationResource with the following
   message:
  
   submit.price=It costs {0,number,currency}!
  
   How can I display that from a JSP? The following
   doesnt work because arg0 is a String.
   bean:message key=submit.price arg0=1234.56/
  
   I havent used JSP tags much.
   http://husted.com/struts/tips/004.html shows the
   following syntax: bean:message
   key=ordering.authorized.range.staff arg0='%=
   config.getStaffAuthAmnt() %'/
   I tried arg0=%= new Double(1234.56) % and it
   wont compile, its expecting a java.lang.String:

 C:\tomcat\work\Standalone\localhost\josh\submit_jsp.java:134:
   setArg0(java.lang.String) in
   org.apache.struts.taglib.bean.MessageTag cannot be
   applied to (java.lang.Double)
 _jspx_th_bean_message_11.setArg0( new
   Double(1234.56) );
  
   What am I doing wrong?
  
   THANKS!
   - Josh

 __
 Do you Yahoo!?
 Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Réf. : Re: I18N - redisplaying a page in an otherLocale

2002-11-22 Thread christophe . godel


Thank you Marcus for your answer. I do appreciate.

I have one more :)
About the html:img with the request parameter, I think you are talking
about a tag like that:
html:img srcKey=logon.flag.src paramId='Local' paramName='en_GB'/
right?

As I wanted to display only the locale that are different than the current one, can I 
put the value of paramName in a resource file
and use a bean:message tag to replace it ?
If I'm in a french page, the value will be 'en' in my resource file. It will looks 
like:
html:img srcKey=logon.flag.src paramId='Local' paramName=bean:message 
key=logon.flag.value/ /

I guess it won't work as it didn't work to fix a value to a hidden file in that way.

Christophe






Extranet
[EMAIL PROTECTED] - 20/11/2002 08:55


Veuillez répondre à [EMAIL PROTECTED]
Pour : struts-user

cc :


Objet : Re: I18N - redisplaying a page in an other Locale


I had the same problem about a week ago( also using Struts 1.02)

Now I am using a seperate Action to change the local.

public ActionForward perform(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse
response){

SetLocalForm setLocalForm = (SetLocalForm)form;
String localString = setLocalForm.getLocal();

Locale local = new Locale(localString, localString);

request.getSession().setAttribute(Action.LOCALE_KEY, local);
return mapping.findForward(setLocalActionDone);
}

and an ActionForm to store to store the local parameter from the jsp.

I guess how to set a parameter on an image should be clear.
(Image Link, link gots local=lang parameter)

marcus

--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]










This message and any attachments (the message) is
intended solely for the addressees and is confidential. 
If you receive this message in error, please delete it and 
immediately notify the sender. Any use not in accord with 
its purpose, any dissemination or disclosure, either whole 
or partial, is prohibited except formal approval. The internet
can not guarantee the integrity of this message. 
BNP PARIBAS (and its subsidiaries) shall (will) not 
therefore be liable for the message if modified. 

-

Ce message et toutes les pieces jointes (ci-apres le 
message) sont etablis a l'intention exclusive de ses 
destinataires et sont confidentiels. Si vous recevez ce 
message par erreur, merci de le detruire et d'en avertir 
immediatement l'expediteur. Toute utilisation de ce 
message non conforme a sa destination, toute diffusion 
ou toute publication, totale ou partielle, est interdite, sauf 
autorisation expresse. L'internet ne permettant pas 
d'assurer l'integrite de ce message, BNP PARIBAS (et ses
filiales) decline(nt) toute responsabilite au titre de ce 
message, dans l'hypothese ou il aurait ete modifie.


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n, resource bundles, bean:message/...

2002-11-22 Thread James Mitchell
 it won't compile, its expecting a java.lang.String:

try this...

 bean:message key=submit.price
   arg0=%= new Double(1234.56).toString() %/



--
James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

If you were plowing a field, which would you rather use? Two strong oxen or
1024 chickens?
- Seymour Cray (1925-1996), father of supercomputing


 -Original Message-
 From: Joshua McCulloch [mailto:[EMAIL PROTECTED]]
 Sent: Friday, November 22, 2002 2:43 PM
 To: [EMAIL PROTECTED]
 Subject: i18n, resource bundles, bean:message/...


 Can someone please help me understand how to use
 arguments for bean:message/ ?

 I have an ApplicationResource with the following
 message:

 submit.price=It costs {0,number,currency}!

 How can I display that from a JSP? The following
 doesnt work because arg0 is a String.
 bean:message key=submit.price arg0=1234.56/

 I havent used JSP tags much.
 http://husted.com/struts/tips/004.html shows the
 following syntax: bean:message
 key=ordering.authorized.range.staff arg0='%=
 config.getStaffAuthAmnt() %'/
 I tried arg0=%= new Double(1234.56) % and it
 wont compile, its expecting a java.lang.String:

 C:\tomcat\work\Standalone\localhost\josh\submit_jsp.java:134:
 setArg0(java.lang.String) in
 org.apache.struts.taglib.bean.MessageTag cannot be
 applied to (java.lang.Double)
   _jspx_th_bean_message_11.setArg0( new
 Double(1234.56) );

 What am I doing wrong?

 THANKS!
 - Josh


 __
 Do you Yahoo!?
 Yahoo! Mail Plus  Powerful. Affordable. Sign up now.
 http://mailplus.yahoo.com

 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n, resource bundles, bean:message/...

2002-11-22 Thread Joshua McCulloch
That shouldn't be any different than 
bean:message key=submit.price arg0=1234.56/

I forgot to mention the exception occuring with that
statement. It looks like the magic happening in the
java.text.* classes with a {0,number,currency}
argument requires a java.lang.Number.

org.apache.jasper.JasperException: Cannot format given
Object as a Number
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:248)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:289)


...etc...

root cause

java.lang.IllegalArgumentException: Cannot format
given Object as a Number
at
java.text.NumberFormat.format(NumberFormat.java:204)
at java.text.Format.format(Format.java:116)
at
java.text.MessageFormat.format(MessageFormat.java:737)
at
java.text.MessageFormat.format(MessageFormat.java:486)
at java.text.Format.format(Format.java:116)

--- James Mitchell [EMAIL PROTECTED] wrote:
  it won't compile, its expecting a
 java.lang.String:
 
 try this...
 
  bean:message key=submit.price
arg0=%= new
 Double(1234.56).toString() %/
 
 
 
 --
 James Mitchell
 Software Engineer/Struts Evangelist
 http://www.open-tools.org
 
 If you were plowing a field, which would you rather
 use? Two strong oxen or
 1024 chickens?
 - Seymour Cray (1925-1996), father of supercomputing
 
 
  -Original Message-
  From: Joshua McCulloch
 [mailto:[EMAIL PROTECTED]]
  Sent: Friday, November 22, 2002 2:43 PM
  To: [EMAIL PROTECTED]
  Subject: i18n, resource bundles,
 bean:message/...
 
 
  Can someone please help me understand how to use
  arguments for bean:message/ ?
 
  I have an ApplicationResource with the following
  message:
 
  submit.price=It costs {0,number,currency}!
 
  How can I display that from a JSP? The following
  doesnt work because arg0 is a String.
  bean:message key=submit.price arg0=1234.56/
 
  I havent used JSP tags much.
  http://husted.com/struts/tips/004.html shows the
  following syntax: bean:message
  key=ordering.authorized.range.staff arg0='%=
  config.getStaffAuthAmnt() %'/
  I tried arg0=%= new Double(1234.56) % and it
  wont compile, its expecting a java.lang.String:
 
 

C:\tomcat\work\Standalone\localhost\josh\submit_jsp.java:134:
  setArg0(java.lang.String) in
  org.apache.struts.taglib.bean.MessageTag cannot be
  applied to (java.lang.Double)
_jspx_th_bean_message_11.setArg0( new
  Double(1234.56) );
 
  What am I doing wrong?
 
  THANKS!
  - Josh
 
 


__
Do you Yahoo!?
Yahoo! Mail Plus – Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n in persistence layer

2002-11-19 Thread James Childers
 
 Which approach is best  for this problem in MVC.
 Join tables or different tables for each language or
 different databases or something else.
 
 
 Dragan

This is actually a non-trivial problem. For a good discussion of this you may want to 
check out the book XML Internationalization and Localization by Yves Savourel. It 
discusses different mechanisms for using XML as a persistence layer in 
internationalized documents, and makes a strong case for using XML instead of an 
RDBMS. But even should you decide to use XML there are different factors to consider 
when structuring your documents, depending on your circumstances.

This is assuming, of course, that the resource bundle mechanism used by Struts doesn't 
adequately meet your needs.

-= James

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n in persistence layer

2002-11-19 Thread Dragan Ljubojevic

What are performance with XML when we have large amount of data?
Concrete situation is table with products in store (name, description, price 
...).

Dragan



 This is actually a non-trivial problem. For a good discussion of this you
 may want to check out the book XML Internationalization and Localization
 by Yves Savourel. It discusses different mechanisms for using XML as a
 persistence layer in internationalized documents, and makes a strong case
 for using XML instead of an RDBMS. But even should you decide to use XML
 there are different factors to consider when structuring your documents,
 depending on your circumstances.

 This is assuming, of course, that the resource bundle mechanism used by
 Struts doesn't adequately meet your needs.

 -= James



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n in persistence layer

2002-11-19 Thread Paananen, Tero
 What are performance with XML when we have large amount of data?
 Concrete situation is table with products in store (name, 
 description, price 
 ...).

Your application will have to cache all that data in
order to perform adequately.

The implications to performance are that your application
will consume more memory than without caching and that
your application startup time is going to increase
(assuming you populate the cache at startup and not
 using lazy initialization).

-TPP

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: I18N - redisplaying a page in an other Locale

2002-11-19 Thread Marcus Biel
I had the same problem about a week ago( also using Struts 1.02)

Now I am using a seperate Action to change the local.

public ActionForward perform(ActionMapping mapping,
ActionForm form, HttpServletRequest request, HttpServletResponse
response){

SetLocalForm setLocalForm = (SetLocalForm)form;
String localString = setLocalForm.getLocal();

Locale local = new Locale(localString, localString);

request.getSession().setAttribute(Action.LOCALE_KEY, local);
return mapping.findForward(setLocalActionDone);
}

and an ActionForm to store to store the local parameter from the jsp.

I guess how to set a parameter on an image should be clear.
(Image Link, link gots local=lang parameter)

marcus

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: re. i18n

2002-10-28 Thread Jeff Born
Thanks for all the information from everyone.  My problem came from not
understanding where I needed to place the UTF-8 line below.  I had placed
this line in all the included jsp, but not the wrapper jsp.  Without being in
the highest level JSP it did not load correctly.  Once I moved it there
everything is fine.

% page contentType=text/html;charset=UTF-8 language=java %
% taglib uri=/WEB-INF/struts-html.tld prefix=html %
html:html locale=true
  jsp:include(s)/
/html:html

jb

-Original Message-
From: James Mitchell [mailto:jmitchtx;telocity.com]
Sent: Tuesday, October 22, 2002 5:08 PM
To: Struts Users Mailing List
Subject: RE: re. i18n


Yes, the struts-example (from the distribution) takes advantage of i18n.

Change (or add) browsers settings to use Russian [ru] or Japanese [ja], make
sure the order of precedence is first for one of those.  And hit your
running app. (you might need to restart tomcat to kill the session if you've
already hit the app using the default locale).

Should work fine from there.

James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former.
- Albert Einstein (1879-1955)


 -Original Message-
 From: Jeff Born [mailto:jborn;gr.com]
 Sent: Tuesday, October 22, 2002 2:32 PM
 To: Struts Users Mailing List (E-mail)
 Subject: re. i18n


 I've had JSTL on my plate of things to look at for some time now.  If it
 makes i18n implementation easier then I'm sold.

 However I still want to see how i18n works in struts.  Does anyone have a
 small war file that has i18n working that they could send me?

 Any help finding a working war file that I can drop into Tomcat
 4.1 would be
 appreciated.

 Thanks,

 jb

 --
 To unsubscribe, e-mail:
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org




--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: RE: re. i18n

2002-10-25 Thread Vernon Wu

To my knowledge, there are two ways to set up locale. One is to use the container's 
configuration setting for 
application. The other is to have an application itself session locale attribute. The 
Struts as well as the PetStore use the 
second approach. The locale setting can be changed inside of the container by either 
calling Config.set method for the 
first approach, or reset the locale variable value,

session.setAttribute(org.apache.struts.action.Action.LOCALE_KEY,newLocale);

for the Struts case for the second approach.

The statement, ?locale is unchangeable during a session? is still not true even in 
Struts. Does your code also 
demonstrate locale resetting?
 

10/22/2002 8:15:28 AM, Russ Bonsall [EMAIL PROTECTED] wrote:


Vernon,

The last time I checked the Pet Store application does not use Struts.  If
you look at the Struts source code you will find that the user's locale is
stored in session and is later used when reconciling which message resources
to use.  Look at the processLocale() method from the RequestProcessor below
(very similar to the processLocale() in ActionServlet for 1.0.2).


Jeff, 

It appears you are doing everything right.  I think you're right in saying
there is something small that you're missing.  You shouldn't need to change
any localization settings through Control Panel.  The browser setting is
what is sent with your request.  I'm sorry I couldn't be of more help.

Russ


protected void processLocale(HttpServletRequest request,
 HttpServletResponse response) {

// Are we configured to select the Locale automatically?
if (!appConfig.getControllerConfig().getLocale()) {
return;
}

// Has a Locale already been selected?
HttpSession session = request.getSession();
if (session.getAttribute(Action.LOCALE_KEY) != null) {
return;
}

// Use the Locale returned by the servlet container (if any)
Locale locale = request.getLocale();
if (locale != null) {
if (log.isDebugEnabled()) {
log.debug( Setting user locale ' + locale + ');
}
session.setAttribute(Action.LOCALE_KEY, locale);
}

}

-Original Message-
From: Vernon Wu [mailto:vernonw;gatewaytech.com]
Sent: Monday, October 21, 2002 4:30 PM
To: [EMAIL PROTECTED]
Subject: re. i18n



I saw the following statement in today mail archive.

   Also keep in mind that the locality is stored in session.  This
means you
   cannot switch languages while using the same session.  The best way
to test
   is by setting your language, close and reopen your browser.

This statement is not true. The Pet Store allows users change the locale
anywhere in the middle of session. You can 
test out yourself by driving a demo version from 
http://developer.java.sun.com/developer/technicalArticles/J2EE/deployathon3/

BTW, the locale information management, including changing locale method,
demonstrated in the latest version PS is 
not the best way by today's standard. Take a look at JSP/JSTL articales on
onjava.com by Hans Bergsten.

Hope this helps.

Vernon







--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: re. i18n

2002-10-22 Thread Russ Bonsall

Vernon,

The last time I checked the Pet Store application does not use Struts.  If
you look at the Struts source code you will find that the user's locale is
stored in session and is later used when reconciling which message resources
to use.  Look at the processLocale() method from the RequestProcessor below
(very similar to the processLocale() in ActionServlet for 1.0.2).


Jeff, 

It appears you are doing everything right.  I think you're right in saying
there is something small that you're missing.  You shouldn't need to change
any localization settings through Control Panel.  The browser setting is
what is sent with your request.  I'm sorry I couldn't be of more help.

Russ


protected void processLocale(HttpServletRequest request,
 HttpServletResponse response) {

// Are we configured to select the Locale automatically?
if (!appConfig.getControllerConfig().getLocale()) {
return;
}

// Has a Locale already been selected?
HttpSession session = request.getSession();
if (session.getAttribute(Action.LOCALE_KEY) != null) {
return;
}

// Use the Locale returned by the servlet container (if any)
Locale locale = request.getLocale();
if (locale != null) {
if (log.isDebugEnabled()) {
log.debug( Setting user locale ' + locale + ');
}
session.setAttribute(Action.LOCALE_KEY, locale);
}

}

-Original Message-
From: Vernon Wu [mailto:vernonw;gatewaytech.com]
Sent: Monday, October 21, 2002 4:30 PM
To: [EMAIL PROTECTED]
Subject: re. i18n



I saw the following statement in today mail archive.

Also keep in mind that the locality is stored in session.  This
means you
cannot switch languages while using the same session.  The best way
to test
is by setting your language, close and reopen your browser.

This statement is not true. The Pet Store allows users change the locale
anywhere in the middle of session. You can 
test out yourself by driving a demo version from 
http://developer.java.sun.com/developer/technicalArticles/J2EE/deployathon3/

BTW, the locale information management, including changing locale method,
demonstrated in the latest version PS is 
not the best way by today's standard. Take a look at JSP/JSTL articales on
onjava.com by Hans Bergsten.

Hope this helps.

Vernon



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




re. i18n

2002-10-22 Thread Jeff Born
I've had JSTL on my plate of things to look at for some time now.  If it
makes i18n implementation easier then I'm sold.

However I still want to see how i18n works in struts.  Does anyone have a
small war file that has i18n working that they could send me?

Any help finding a working war file that I can drop into Tomcat 4.1 would be
appreciated.

Thanks,

jb

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: re. i18n

2002-10-22 Thread James Mitchell
Yes, the struts-example (from the distribution) takes advantage of i18n.

Change (or add) browsers settings to use Russian [ru] or Japanese [ja], make
sure the order of precedence is first for one of those.  And hit your
running app. (you might need to restart tomcat to kill the session if you've
already hit the app using the default locale).

Should work fine from there.

James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org

Only two things are infinite, the universe and human stupidity, and I'm not
sure about the former.
- Albert Einstein (1879-1955)


 -Original Message-
 From: Jeff Born [mailto:jborn;gr.com]
 Sent: Tuesday, October 22, 2002 2:32 PM
 To: Struts Users Mailing List (E-mail)
 Subject: re. i18n


 I've had JSTL on my plate of things to look at for some time now.  If it
 makes i18n implementation easier then I'm sold.

 However I still want to see how i18n works in struts.  Does anyone have a
 small war file that has i18n working that they could send me?

 Any help finding a working war file that I can drop into Tomcat
 4.1 would be
 appreciated.

 Thanks,

 jb

 --
 To unsubscribe, e-mail:
 mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org




--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: i18n

2002-10-21 Thread Jeff Born
I have three ApplicationResources.properties files.

ApplicationResources.properties
ApplicationResources_es.properties
ApplicationResources_ru.properties

and the following line in the struts-config.xml file:
!-- == Message Resources Definitions === --
message-resources parameter=ApplicationResources/

I can restart Tomcat 4.1 after resetting the region via
Control Panel-Regional Settings- Changing locale through the DDL to either:
Spanish (Mexico) or
Russian

I can get the es file to work fine this way, but not the ru file

However When I attempt to change the IE language settings I continuously get
English.  (After changing all the regional settings back to US English) I
have shut down all IE windows and opened a new window to test this.  Still
nothing English is display on my website, however google recognizes the
change, so I know I have IE set up correctly.

This process doesn't seem like it should be that difficult, so I am probably
missing something small somewhere.

Thanks for all the suggestions in advance. (And thanks Russ, any other ideas
on where to check?)

jb

-Original Message-
From: Russ Bonsall [mailto:rbonsall;computer-guidance.com]
Sent: Monday, October 21, 2002 2:18 PM
To: Jeff Born; Struts Users Mailing List (E-mail)
Subject: RE: i18n



Make sure you have named your application resource files correctly.  There
must be a property file for the locality you expect to use.
For example,
(default set) ApplicationResources.properties
(French set) ApplicationResources_fr.properties

Also keep in mind that the locality is stored in session.  This means you
cannot switch languages while using the same session.  The best way to test
is by setting your language, close and reopen your browser.

Russ

-Original Message-
From: Jeff Born [mailto:jborn;gr.com]
Sent: Monday, October 21, 2002 10:12 AM
To: Struts Users Mailing List (E-mail)
Subject: i18n


I've been playing around with i18n and Struts and have gotten it to work via
changing my Regional Settings and restarting Tomcat. However it is my
understanding I should be able to update the Tools-Internet
Options-Languages-Add... Add a Language and then move it up in priority.
I've tested this out using Google and it works just fine. However I can't
seem to get my struts application to work the same way. I've also looked at
the struts tutorial on i18n and have had no luck with that example also. Is
there anyone I can send a war files to that has worked with i18n and point
out the error in my ways?

Thanks,

jb

--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




re. i18n

2002-10-21 Thread Vernon Wu

I saw the following statement in today mail archive.

Also keep in mind that the locality is stored in session.  This means you
cannot switch languages while using the same session.  The best way to test
is by setting your language, close and reopen your browser.

This statement is not true. The Pet Store allows users change the locale anywhere in 
the middle of session. You can 
test out yourself by driving a demo version from 
http://developer.java.sun.com/developer/technicalArticles/J2EE/deployathon3/

BTW, the locale information management, including changing locale method, demonstrated 
in the latest version PS is 
not the best way by today's standard. Take a look at JSP/JSTL articales on onjava.com 
by Hans Bergsten.

Hope this helps.

Vernon



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: i18n messages in javascript js file

2002-10-20 Thread sridhar
Thanks James,
That's how we had implemented for now, but is it right to have just
javavascript code in a separate jsp and include it in all the other jsp's.
is there any better solution ?

sridhar

- Original Message -
From: James Mitchell [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Sunday, October 20, 2002 2:06 AM
Subject: RE: i18n messages in javascript js file


 Yes you can.

 Since you are using a .js file (client side include), if you prefer to
have
 the least amount of impact on your application, change it to a .jsp file
and
 add the necessary changes (adding bean:message for each i18n'd message)

 Is this enough info?

 If you need further assistance, submit a portion of your validation
scripts
 and I'll send you back a working example.


 James Mitchell
 Software Engineer/Struts Evangelist
 http://www.open-tools.org




  -Original Message-
  From: sridhar [mailto:sridhard;tatanova.com]
  Sent: Saturday, October 19, 2002 2:21 PM
  To: [EMAIL PROTECTED]
  Subject: i18n messages in javascript js file
 
 
  My application uses javascript validations (at the client side)
  and all the validations are done in a validate.js file and
  displays the error messages with alerts. And all the messages in
  the javascript are hardcoded and the js file is used in many
  jsp's. Can i make the messages internationalized using struts
  frames work? if yes how can i do that ?
 
  thanks in advance.
  sridhar
 


 --
 To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
 For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org




--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: i18n messages in javascript js file

2002-10-20 Thread James Mitchell
Have you taken a look at using the validator (its part of core struts now)?

By using this validation framework, you can add both client side and server
side validations to your web application.

You can get up to speed by reading the docs or (as I prefer) run the
struts-example and 'take a look under the hood'.


James Mitchell
Software Engineer/Struts Evangelist
http://www.open-tools.org




 -Original Message-
 From: sridhar [mailto:sridhard;tatanova.com]
 Sent: Sunday, October 20, 2002 12:12 PM
 To: Struts Users Mailing List
 Cc: [EMAIL PROTECTED]
 Subject: Re: i18n messages in javascript js file


 Thanks James,
 That's how we had implemented for now, but is it right to have just
 javavascript code in a separate jsp and include it in all the other jsp's.
 is there any better solution ?

 sridhar

 - Original Message -
 From: James Mitchell [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Sunday, October 20, 2002 2:06 AM
 Subject: RE: i18n messages in javascript js file


  Yes you can.
 
  Since you are using a .js file (client side include), if you prefer to
 have
  the least amount of impact on your application, change it to a .jsp file
 and
  add the necessary changes (adding bean:message for each i18n'd message)
 
  Is this enough info?
 
  If you need further assistance, submit a portion of your validation
 scripts
  and I'll send you back a working example.
 
 
  James Mitchell
  Software Engineer/Struts Evangelist
  http://www.open-tools.org
 
 
 
 
   -Original Message-
   From: sridhar [mailto:sridhard;tatanova.com]
   Sent: Saturday, October 19, 2002 2:21 PM
   To: [EMAIL PROTECTED]
   Subject: i18n messages in javascript js file
  
  
   My application uses javascript validations (at the client side)
   and all the validations are done in a validate.js file and
   displays the error messages with alerts. And all the messages in
   the javascript are hardcoded and the js file is used in many
   jsp's. Can i make the messages internationalized using struts
   frames work? if yes how can i do that ?
  
   thanks in advance.
   sridhar
  
 
 
  --
  To unsubscribe, e-mail:
 mailto:struts-user-unsubscribe;jakarta.apache.org
  For additional commands, e-mail:
 mailto:struts-user-help;jakarta.apache.org
 
 


 --
 To unsubscribe, e-mail:
mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail:
mailto:struts-user-help;jakarta.apache.org



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: i18n messages in javascript js file

2002-10-19 Thread CuteProgrammer

I think this works fine for u

JS Function
function _alert(key)
{  
   var url=/app/view/jsp/Alert.jsp?name=+key;   
   
window.showModalDialog(url,null,'dialogHeight:120px;dialogWidth:400px;scroll:no;status:no');
   
   return false;
}

Alert.jsp
%
  String _key=null;
  if(request.getParameter(name)!=null)
_key=request.getParameter(name);  
%
bean:message key=%= _key % locale=app_sitelanguage /


Just pass the key as a parameter for the function _alert(key)
where u can get this key from property file

Regards
Varma


- Original Message - 
From: sridhar [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, October 19, 2002 11:51 PM
Subject: i18n messages in javascript js file


My application uses javascript validations (at the client side) and all the 
validations are done in a validate.js file and displays the error messages with 
alerts. And all the messages in the javascript are hardcoded and the js file is used 
in many jsp's. Can i make the messages internationalized using struts frames work? if 
yes how can i do that ?

thanks in advance.
sridhar



--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: i18n messages in javascript js file

2002-10-19 Thread CuteProgrammer

 I think this works fine for u

 JS Function
 function _alert(key)


var url=/app/view/jsp/Alert.jsp?name=+key;

window.showModalDialog(url,null,'dialogHeight:120px;dialogWidth:400px;scroll
:no;status:no');
return false;
 }

 Alert.jsp
 %
   String _key=null;
   if(request.getParameter(name)!=null)
 _key=request.getParameter(name);
 %
 bean:message key=%= _key % locale=app_sitelanguage /


 Just pass the key as a parameter for the function _alert(key)
 where u can get this key from property file
 Regards
 Varma
- Original Message -
From: sridhar [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, October 19, 2002 11:51 PM
Subject: i18n messages in javascript js file


My application uses javascript validations (at the client side) and all the
validations are done in a validate.js file and displays the error messages
with alerts. And all the messages in the javascript are hardcoded and the js
file is used in many jsp's. Can i make the messages internationalized using
struts frames work? if yes how can i do that ?

thanks in advance.
sridhar


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: i18n and images

2002-10-18 Thread Eddie Bush
You could just list all of the images in the properties file - instead 
of just having the country code.  If you actually put your path in 
there, you could use the srcKey to specify where it is picked from and 
let the property-loading mechanism take it from there.

That work?

I have no need for internationalization, so I can't speak to *the* 
solution - I think what I propose is reasonable though.

Jeff Born wrote:

Right now I have created an images directory and an es, ru, etc..
directories under images to house all of my i18n images.

To reference them I have placed another key in the
ApplicationResouces.properties files called countrycode

I then find the image with src=imagesbean:message
key=countrycode//imagename.gif

Any one else doing it this way?  Is there a better way?  I'm not that far
into the project and now is the time to change!

Thanks,

jb



--
Eddie Bush




--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




RE: i18n and images + creating an i18n input file for native2ascii

2002-10-18 Thread Jeff Born
I've been trying to avoid listing all the images in the properties files.
Right now using the same image name and passing the i18n directory name in
seems to work and requires the least amount of upkeep.

Also I am trying to find a program that outputs a cyrillic text file to be
used as input for native2ascii?  Any suggestions?

Thanks,

jb

-Original Message-
From: Eddie Bush [mailto:ekbush;swbell.net]
Sent: 17 îêòÿáðÿ 2002 ã. 14:32
To: Struts Users Mailing List
Subject: Re: i18n and images


You could just list all of the images in the properties file - instead 
of just having the country code.  If you actually put your path in 
there, you could use the srcKey to specify where it is picked from and 
let the property-loading mechanism take it from there.

That work?

I have no need for internationalization, so I can't speak to *the* 
solution - I think what I propose is reasonable though.

Jeff Born wrote:

Right now I have created an images directory and an es, ru, etc..
directories under images to house all of my i18n images.

To reference them I have placed another key in the
ApplicationResouces.properties files called countrycode

I then find the image with src=imagesbean:message
key=countrycode//imagename.gif

Any one else doing it this way?  Is there a better way?  I'm not that far
into the project and now is the time to change!

Thanks,

jb


-- 
Eddie Bush




--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org


--
To unsubscribe, e-mail:   mailto:struts-user-unsubscribe;jakarta.apache.org
For additional commands, e-mail: mailto:struts-user-help;jakarta.apache.org




Re: i18n

2002-09-05 Thread Ted Husted

Without getting into implementation issues, the important thing to note 
is that Struts uses the same MessageFormat class and follows the same 
rules for loading a bundle. From a application development standpoint, 
you won't know the difference. Any bundles you can use with 
ResourceBundle you can use with MessageResources (and vice versa).

There are some discussions about a JDBCMessageResource class happening 
on the DEV list. If you are interested in the underlying implementation, 
you might stop in there.

As noted, some parts of Struts predate what is now available. If the 
JSTL had been out two years ago, most of the taglibs would never had 
been written. If filters had been available sooner, the control layer 
would also be different. (And may be, post 1.1)

But as standards become available, you can expect Struts to fall in 
line. As a volunteer project, we don't always have the resources to make 
sweeping internal changes to the codebase, but you can expect the 
top-level APIs to be compatible. As they are between MessageResources 
and ResourceBundle.

-Ted.

K.Viswanathan wrote:

 
 I am asking about general programming. I'd like to know What are the
 advantages of MessageResources/PropertyMessages of  struts.util over the
 ResourceBundle ( and other related classes )of java.
 
 
 Excerpts from Chuck Cavaness's book ( chapter 3) :
 The Java library includes a set of classes to support reading message
 resources from either a Java class or a properties file. The core class in
 this set is the java.util.ResourceBundle. The Struts framework provides a
 similar set of classes, based around the
 org.apache.struts.util.MessageResources class that provides similar
 functionality, but provides for a little more flexibility that the framework
 requires.
 
 The standard Java support for Internationalization has grown with the past
 several releases and the Struts framework could probably use what's included
 with 1.2 and newer, but since Struts was created before 1.2, they had to
 build in their own support for several key pieces. .
 
 Chuck Cavaness's book  ( chapter  12)states that
 
  The Struts framework does not use the ResourceBundle provided by the core
 language. Instead, it provides similar functionality with the classes within
 its framework. The org.apache.struts.util.MessageResources class and its
 only concrete subclass, org.apache.struts.util.PropertyMessageResources, are
 used to perform parallel functionality to that of the ResourceBundle
 hierarchy. ..
 
 Thanks
 Vishy
 
 
 
 
 
 
 - Original Message -
 From: Michael [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Wednesday, September 04, 2002 6:14 PM
 Subject: RE: i18n
 
 
 
I'm not sure what you mean.  Are you talking about general programming
or for HTML pages generated with a struts application?  For the latter,
you do not need to use thoses classes, struts does it all for you.


-Original Message-
From: K.Viswanathan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 04, 2002 1:56 PM
To: Struts Users Mailing List
Subject: Re: i18n




Yes. Tag libraries are useful but what I wanted to know is
what are the
advantages of using MessageResources,
PropertyMessageResources etc .
We can define simple .properties files for every locale and
use ResourceBundles to get the data inside the message tag.
Are there any advantage of using the classes mentioned above?

Thanks
Vishy

- Original Message -
From: Michael [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, September 04, 2002 4:59 PM
Subject: RE: i18n



I'd be happy if anyone could clarify my basic doubt

related to i18n

. I'd like to know what are the added features related to I18n
implemented in Struts over the one already supported by

java? what

are the advantages of

org.apache.struts.util.MessageResources  ( and

other related
classes) over ResourceBundle?

With struts you can use the

bean:message key=base.title/

To get the text out of a resource properties file.  Struts will use
the locale defined in the user's browser preferences.

Michael




--
To unsubscribe, e-mail:

mailto:[EMAIL PROTECTED]

For additional commands, e-mail:

mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
mailto:struts-user- [EMAIL PROTECTED]
For
additional commands,
e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:

 mailto:[EMAIL PROTECTED]
 
For additional commands, e-mail:

 mailto:[EMAIL PROTECTED]
 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]
 
 


-- 
Ted Husted, Husted dot Com, Fairport NY US
co-author, Java Web Development with Struts
Order it today:
http://husted.com/struts/book.html


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n

2002-09-05 Thread K.Viswanathan

Thanks Ted. :)
Vishy

- Original Message -
From: Ted Husted [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Thursday, September 05, 2002 3:10 PM
Subject: Re: i18n


 Without getting into implementation issues, the important thing to note
 is that Struts uses the same MessageFormat class and follows the same
 rules for loading a bundle. From a application development standpoint,
 you won't know the difference. Any bundles you can use with
 ResourceBundle you can use with MessageResources (and vice versa).

 There are some discussions about a JDBCMessageResource class happening
 on the DEV list. If you are interested in the underlying implementation,
 you might stop in there.

 As noted, some parts of Struts predate what is now available. If the
 JSTL had been out two years ago, most of the taglibs would never had
 been written. If filters had been available sooner, the control layer
 would also be different. (And may be, post 1.1)

 But as standards become available, you can expect Struts to fall in
 line. As a volunteer project, we don't always have the resources to make
 sweeping internal changes to the codebase, but you can expect the
 top-level APIs to be compatible. As they are between MessageResources
 and ResourceBundle.

 -Ted.

 K.Viswanathan wrote:

 
  I am asking about general programming. I'd like to know What are the
  advantages of MessageResources/PropertyMessages of  struts.util over the
  ResourceBundle ( and other related classes )of java.
 
 
  Excerpts from Chuck Cavaness's book ( chapter 3) :
  The Java library includes a set of classes to support reading message
  resources from either a Java class or a properties file. The core class
in
  this set is the java.util.ResourceBundle. The Struts framework provides
a
  similar set of classes, based around the
  org.apache.struts.util.MessageResources class that provides similar
  functionality, but provides for a little more flexibility that the
framework
  requires.
 
  The standard Java support for Internationalization has grown with the
past
  several releases and the Struts framework could probably use what's
included
  with 1.2 and newer, but since Struts was created before 1.2, they had to
  build in their own support for several key pieces. .
 
  Chuck Cavaness's book  ( chapter  12)states that
 
   The Struts framework does not use the ResourceBundle provided by the
core
  language. Instead, it provides similar functionality with the classes
within
  its framework. The org.apache.struts.util.MessageResources class and its
  only concrete subclass, org.apache.struts.util.PropertyMessageResources,
are
  used to perform parallel functionality to that of the ResourceBundle
  hierarchy. ..
 
  Thanks
  Vishy
 
 
 
 
 
 
  - Original Message -
  From: Michael [EMAIL PROTECTED]
  To: 'Struts Users Mailing List' [EMAIL PROTECTED]
  Sent: Wednesday, September 04, 2002 6:14 PM
  Subject: RE: i18n
 
 
 
 I'm not sure what you mean.  Are you talking about general programming
 or for HTML pages generated with a struts application?  For the latter,
 you do not need to use thoses classes, struts does it all for you.
 
 
 -Original Message-
 From: K.Viswanathan [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, September 04, 2002 1:56 PM
 To: Struts Users Mailing List
 Subject: Re: i18n
 
 
 
 
 Yes. Tag libraries are useful but what I wanted to know is
 what are the
 advantages of using MessageResources,
 PropertyMessageResources etc .
 We can define simple .properties files for every locale and
 use ResourceBundles to get the data inside the message tag.
 Are there any advantage of using the classes mentioned above?
 
 Thanks
 Vishy
 
 - Original Message -
 From: Michael [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Wednesday, September 04, 2002 4:59 PM
 Subject: RE: i18n
 
 
 
 I'd be happy if anyone could clarify my basic doubt
 
 related to i18n
 
 . I'd like to know what are the added features related to I18n
 implemented in Struts over the one already supported by
 
 java? what
 
 are the advantages of
 
 org.apache.struts.util.MessageResources  ( and
 
 other related
 classes) over ResourceBundle?
 
 With struts you can use the
 
 bean:message key=base.title/
 
 To get the text out of a resource properties file.  Struts will use
 the locale defined in the user's browser preferences.
 
 Michael
 
 
 
 
 --
 To unsubscribe, e-mail:
 
 mailto:[EMAIL PROTECTED]
 
 For additional commands, e-mail:
 
 mailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:
 mailto:struts-user- [EMAIL PROTECTED]
 For
 additional commands,
 e-mail: mailto:[EMAIL PROTECTED]
 
 
 --
 To unsubscribe, e-mail:
 
  mailto:[EMAIL PROTECTED]
 
 For additional commands, e-mail:
 
  mailto:[EMAIL PROTECTED]
 
 
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
mailto:[EMAIL PROTECTED]
 
 


 --
 Ted Husted, Husted dot Com, Fairport NY US
 co

RE: i18n

2002-09-04 Thread Michael

 I'd be happy if anyone could clarify my basic doubt related 
 to i18n . I'd like to know what are the added features 
 related to I18n implemented in Struts over the one already 
 supported by java? what are the advantages of 
 org.apache.struts.util.MessageResources  ( and other related 
 classes) over ResourceBundle?

With struts you can use the 

bean:message key=base.title/

To get the text out of a resource properties file.  Struts will use the
locale defined in the user's browser preferences.

Michael




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n

2002-09-04 Thread K.Viswanathan



Yes. Tag libraries are useful but what I wanted to know is what are the
advantages of using MessageResources,PropertyMessageResources etc .
We can define simple .properties files for every locale and use
ResourceBundles to get the data inside the message tag. Are there any
advantage of using the classes mentioned above?

Thanks
Vishy

- Original Message -
From: Michael [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, September 04, 2002 4:59 PM
Subject: RE: i18n


  I'd be happy if anyone could clarify my basic doubt related
  to i18n . I'd like to know what are the added features
  related to I18n implemented in Struts over the one already
  supported by java? what are the advantages of
  org.apache.struts.util.MessageResources  ( and other related
  classes) over ResourceBundle?

 With struts you can use the

 bean:message key=base.title/

 To get the text out of a resource properties file.  Struts will use the
 locale defined in the user's browser preferences.

 Michael




 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n

2002-09-04 Thread Michael

I'm not sure what you mean.  Are you talking about general programming
or for HTML pages generated with a struts application?  For the latter,
you do not need to use thoses classes, struts does it all for you.

 -Original Message-
 From: K.Viswanathan [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, September 04, 2002 1:56 PM
 To: Struts Users Mailing List
 Subject: Re: i18n
 
 
 
 
 Yes. Tag libraries are useful but what I wanted to know is 
 what are the
 advantages of using MessageResources,
 PropertyMessageResources etc .
 We can define simple .properties files for every locale and 
 use ResourceBundles to get the data inside the message tag. 
 Are there any advantage of using the classes mentioned above?
 
 Thanks
 Vishy
 
 - Original Message -
 From: Michael [EMAIL PROTECTED]
 To: 'Struts Users Mailing List' [EMAIL PROTECTED]
 Sent: Wednesday, September 04, 2002 4:59 PM
 Subject: RE: i18n
 
 
   I'd be happy if anyone could clarify my basic doubt 
 related to i18n 
   . I'd like to know what are the added features related to I18n 
   implemented in Struts over the one already supported by 
 java? what 
   are the advantages of 
 org.apache.struts.util.MessageResources  ( and 
   other related
   classes) over ResourceBundle?
 
  With struts you can use the
 
  bean:message key=base.title/
 
  To get the text out of a resource properties file.  Struts will use 
  the locale defined in the user's browser preferences.
 
  Michael
 
 
 
 
  --
  To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:struts-user- [EMAIL PROTECTED]
 For 
 additional commands, 
 e-mail: mailto:[EMAIL PROTECTED]
 


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n

2002-09-04 Thread K.Viswanathan



I am asking about general programming. I'd like to know What are the
advantages of MessageResources/PropertyMessages of  struts.util over the
ResourceBundle ( and other related classes )of java.


Excerpts from Chuck Cavaness's book ( chapter 3) :
The Java library includes a set of classes to support reading message
resources from either a Java class or a properties file. The core class in
this set is the java.util.ResourceBundle. The Struts framework provides a
similar set of classes, based around the
org.apache.struts.util.MessageResources class that provides similar
functionality, but provides for a little more flexibility that the framework
requires.

The standard Java support for Internationalization has grown with the past
several releases and the Struts framework could probably use what's included
with 1.2 and newer, but since Struts was created before 1.2, they had to
build in their own support for several key pieces. .

Chuck Cavaness's book  ( chapter  12)states that

 The Struts framework does not use the ResourceBundle provided by the core
language. Instead, it provides similar functionality with the classes within
its framework. The org.apache.struts.util.MessageResources class and its
only concrete subclass, org.apache.struts.util.PropertyMessageResources, are
used to perform parallel functionality to that of the ResourceBundle
hierarchy. ..

Thanks
Vishy






- Original Message -
From: Michael [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, September 04, 2002 6:14 PM
Subject: RE: i18n


 I'm not sure what you mean.  Are you talking about general programming
 or for HTML pages generated with a struts application?  For the latter,
 you do not need to use thoses classes, struts does it all for you.

  -Original Message-
  From: K.Viswanathan [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, September 04, 2002 1:56 PM
  To: Struts Users Mailing List
  Subject: Re: i18n
 
 
 
 
  Yes. Tag libraries are useful but what I wanted to know is
  what are the
  advantages of using MessageResources,
  PropertyMessageResources etc .
  We can define simple .properties files for every locale and
  use ResourceBundles to get the data inside the message tag.
  Are there any advantage of using the classes mentioned above?
 
  Thanks
  Vishy
 
  - Original Message -
  From: Michael [EMAIL PROTECTED]
  To: 'Struts Users Mailing List' [EMAIL PROTECTED]
  Sent: Wednesday, September 04, 2002 4:59 PM
  Subject: RE: i18n
 
 
I'd be happy if anyone could clarify my basic doubt
  related to i18n
. I'd like to know what are the added features related to I18n
implemented in Struts over the one already supported by
  java? what
are the advantages of
  org.apache.struts.util.MessageResources  ( and
other related
classes) over ResourceBundle?
  
   With struts you can use the
  
   bean:message key=base.title/
  
   To get the text out of a resource properties file.  Struts will use
   the locale defined in the user's browser preferences.
  
   Michael
  
  
  
  
   --
   To unsubscribe, e-mail:
  mailto:[EMAIL PROTECTED]
   For additional commands, e-mail:
  mailto:[EMAIL PROTECTED]
  
 
 
  --
  To unsubscribe, e-mail:
  mailto:struts-user- [EMAIL PROTECTED]
  For
  additional commands,
  e-mail: mailto:[EMAIL PROTECTED]
 


 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: [I18N] Locale Mysteriously Reverts to null

2002-08-31 Thread James Mitchell

That sounds a bit odd.  What container are you using?

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta




 -Original Message-
 From: David Geary [mailto:[EMAIL PROTECTED]]
 Sent: Saturday, August 31, 2002 10:51 PM
 To: [EMAIL PROTECTED]
 Subject: [I18N] Locale Mysteriously Reverts to null
 
 
 I have an action that sets the user's locale with Action.setLocale(). 
 After I set the locale, I verify that it's been set with 
 request.getSession().getAttribute(Action.LOCALE_KEY). It has.
 
 Then the action forwards to a JSP page and within that JSP page, the 
 locale is null, which I verify with
 %= session.getAttribute(Action.LOCALE_KEY) %.
 
 How do I make the locale stick, and why does it revert to null?
 
 Thanks,
 
 
 david
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: [I18N] Locale Mysteriously Reverts to null

2002-08-31 Thread David Geary

Resin 2.1.2. I hadn't thought to try it with another container, so I 
tried it with Tomcat 4.1.3, and it works as expected, that is, the 
locale doesn't revert back to null.

I just assumed it was something I was doing wrong, but evidently it's a 
Resin bug.

Thanks,


david

James Mitchell wrote:

That sounds a bit odd.  What container are you using?

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta
  

-Original Message-
From: David Geary [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 31, 2002 10:51 PM
To: [EMAIL PROTECTED]
Subject: [I18N] Locale Mysteriously Reverts to null


I have an action that sets the user's locale with Action.setLocale(). 
After I set the locale, I verify that it's been set with 
request.getSession().getAttribute(Action.LOCALE_KEY). It has.

Then the action forwards to a JSP page and within that JSP page, the 
locale is null, which I verify with
%= session.getAttribute(Action.LOCALE_KEY) %.

How do I make the locale stick, and why does it revert to null?

Thanks,


david


--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]





--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


  





Re: [I18N] Locale Mysteriously Reverts to null

2002-08-31 Thread David Geary

Resin 2.1.2. I hadn't thought to try it with another container, so I 
tried it with Tomcat 4.1.3, and it works as expected, that is, the 
locale doesn't revert back to null.

I assumed it was something I was doing wrong, but evidently it must be a 
Resin bug.

Thanks,


david

James Mitchell wrote:

That sounds a bit odd.  What container are you using?

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://www.open-tools.org/struts-atlanta
  

-Original Message-
From: David Geary [mailto:[EMAIL PROTECTED]]
Sent: Saturday, August 31, 2002 10:51 PM
To: [EMAIL PROTECTED]
Subject: [I18N] Locale Mysteriously Reverts to null


I have an action that sets the user's locale with Action.setLocale(). 
After I set the locale, I verify that it's been set with 
request.getSession().getAttribute(Action.LOCALE_KEY). It has.

Then the action forwards to a JSP page and within that JSP page, the 
locale is null, which I verify with
%= session.getAttribute(Action.LOCALE_KEY) %.

How do I make the locale stick, and why does it revert to null?

Thanks,


david


--
To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: 
mailto:[EMAIL PROTECTED]





--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


  





Re: I18N and locales

2002-08-16 Thread Steinar Bang

 David Graham [EMAIL PROTECTED]:

 Cool, but how do I i18n the text so that I can put it in the request?

Put an init-param element inside the servlet element of the
web.xml file of the servlet, referring to the Struts Action servlet,
that refers to a resource bundle.

Eg. 
  servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameapplication/param-name
  param-valueMyResources/param-value
/init-param

This will refer to files named
/WEB-INF/classes/MyResources.properties
/WEB-INF/classes/MyResources_no.properties
/WEB-INF/classes/MyResources_en_GB.properties

The .properties files contains key/value pairs, where the keys are the
keys given to bean:message and the values are what is shown.

In the example above _no designates a file with Norwegian values,
and _en_GB designates a file with UK English values.

The file named MyResources.properties contain the default values.



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: I18N and locales

2002-08-08 Thread Craig R. McClanahan



On Thu, 8 Aug 2002, David Graham wrote:

 Date: Thu, 08 Aug 2002 13:21:47 -0600
 From: David Graham [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: I18N and locales

 When using the bean:message tag do you have to supply a different locale
 key to change the language it uses?  I was under the impression that struts
 handles this automatically but reading the docs again seemed to indicate
 otherwise.  I use the tag like this:
 bean:message key=button.add/

 If a browser hits the page and specifies a different locale than english,
 does struts select the right resource file or do I have to do something?


Struts manages the choice of language by maintaining a Locale object under
a well-known session attribute key (Action.LOCALE_KEY).  If there isn't
one already, it is set automatically based on the browser's
Accept-Language header.  However, your app can replace the default one --
for example, if you offered a select language option.

 Also, in one of my actions, after I save info to a database, I want to put a
 message in the request before I forward to the success page.  The success
 page would display whatever message it receives.  What struts class do I use
 in java code to retrieve i18n messages like the bean:message tag?


If you have internationalized the text of the message already, you can
just store the String as a request or session attribute, and display it
with the bean:write tag.  For example (assuming you stored the text
as a request attribute named foo):

  bean:write name=foo/

If you want the output page to internationalize the text (by looking it up
in your application resources), store the message *key* as a request or
session attribute, and use that as the argument to a bean:message call
on the destination page.  For example (assuming you stored the correct key
as a request attribute named foo):

  bean:message key='%= (String) request.getAttribute(foo) %'/


 Thanks,
 Dave


Craig


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: I18N and locales

2002-08-08 Thread David Graham

Thanks for the info Craig!  More questions below...

If you have internationalized the text of the message already, you can
just store the String as a request or session attribute, and display it
with the bean:write tag.  For example (assuming you stored the text
as a request attribute named foo):

   bean:write name=foo/

Cool, but how do I i18n the text so that I can put it in the request?  My 
Action class' code needs to look up a key in the appropriate resource file.  
What struts class would I use to do this?  I could just as easily do it the 
other way you suggested but I would like to know if this is possible.

Thanks,
Dave


_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: I18N and locales

2002-08-08 Thread Craig R. McClanahan



On Thu, 8 Aug 2002, David Graham wrote:

 Date: Thu, 08 Aug 2002 13:41:48 -0600
 From: David Graham [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Re: I18N and locales

 Thanks for the info Craig!  More questions below...

 If you have internationalized the text of the message already, you can
 just store the String as a request or session attribute, and display it
 with the bean:write tag.  For example (assuming you stored the text
 as a request attribute named foo):
 
bean:write name=foo/

 Cool, but how do I i18n the text so that I can put it in the request?  My
 Action class' code needs to look up a key in the appropriate resource file.
 What struts class would I use to do this?  I could just as easily do it the
 other way you suggested but I would like to know if this is possible.


I suggest reading the JavaDoc comments about the global constants in
org.apache.struts.action.Action -- you'll find out a lot of stuff about
where Struts stores all of its internal data structures.

If you need access to the message resources from your Action, that's
straightforward as well:

  MessageResources resources = (MessageResources)
getServlet().getServletContext().getAttribute(Action.MessagesKey +
  appPrefix);
  String text = resources.getMessage(my.key);

If you have more than one message resources defined for your subapp, the
extra ones are stored under whatever attribute name you specified with the
bundle attribute.

Of course, if you followed my second suggestion and just passed the key,
instead of the internationalized text (and used bean:message in the
destination page), you wouldn't have to do this.



 Thanks,
 Dave

Craig


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n on html:submit tag

2002-07-08 Thread Lisa van Gelder

Don't worry. Worked it out. :)

You can put the i18n key in the middle of the tag.
html:submitbean:message key=my.key//html:submit

That wasn't obvious to me from the user guide!

Lisa



RE: i18n is killing me!

2002-07-08 Thread Brian Topping

 -Original Message-
 From: Zayed [mailto:[EMAIL PROTECTED]]
 Subject: Re: i18n is killing me!
 
 
 try by renaming your properties file as XXX_en_US.properties.
 
 Cheers!!
 Zayed

Thanks for the tip, no, doesn't work.  Makes *no* sense.  

Gurus:  Is there any points in the struts code that I should be checking for
brain damage?  I'm completely set up in my debugger to debug my application
and struts together, I've traced the configuration object getting created
(not too interesting), and I've traced into the call to get the property.
I'm not too up on how all this works, but it seems like struts is trying to
take over the job of i18n from the JVM and not doing it quite right.  It
seems like others have been having problems with this (Babs Post) and would
like to find a more robust fix.

best,

-b

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n is killing me!

2002-07-07 Thread Zayed

try by renaming your properties file as XXX_en_US.properties.

Cheers!!
Zayed

[EMAIL PROTECTED] wrote:

hiyas, 

can anyone lend a hand with i18n?  it's starting to feel like i81n!! :/

environment is struts 1.1b1, win2k, jboss 3.0/tomcat 4.0.3 release, default
locale is en_US.

i have a web-inf/classes/ApplicationResources.properties as well as
web-inf/classes/ApplicationResources_en.properties for good measure.  In my
struts-config.xml, i have message-resources parameter=ApplicationResources
key=org.apache.struts.action.MESSAGE null=false/.

it seems like i should be able to get something with:

System.out.println(messages.getMessage(Locale.getDefault(),error.transaction
.token));

but I get nothing but the bad property string (since the null config
attribute is set to false).  error.transaction.token is defined in both
files, the spelling is checked a hundred times, etc.

Of course, ActionError(error.transaction.token) gives the same error
result.

Anything that ppl can think that i missing?  i've spent the whole day on
this!!

thanks a bunch,

-b

_ 
If you have some ice cream, I will give it to you. 
If you have no ice cream, I will take it away from you. 
 - Ice Cream Koan


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n Gets Even Weirder: It is Reading from the File, but Only Certain Languages and a Mystery Value

2002-07-02 Thread Jesse Alexander (KADA 11)

Hi,

have you specified the correct charset in the html-header?
meta http-equiv=content-type content=text/html; charset=ISO-8859-1
Well it will not be ISO-8859-1, but something different. This website
should tell you which (in case...): http://www.iana.org/assignments/character-sets

hope this helps
Alexander


-Original Message-
From: micael [mailto:[EMAIL PROTECTED]]
Sent: Montag, 1. Juli 2002 06:49
To: Struts Users Mailing List
Subject: i18n Gets Even Weirder: It is Reading from the File, but Only
Certain Languages and a Mystery Value


Here are the really odd facts.  1) I know the app is finding my 
Resources_zh.properties file when the browser is set for Chinese, because 
if I use English values for the keys and change their value in 
Resources_zh.properties but no where else, the values come up in the 
browsers.  2) However, if I change the value to unicode for Chinese, the 
old values show up, and those values are not in any file at all at that 
time.  They have to be coming from cache.  3) then, if I change the unicode 
back to different English than it ever was, that changes and shows 
up.  Does anyone have any idea on any of this?

At 03:13 PM 6/30/2002 -0700, you wrote:


On Sun, 30 Jun 2002, micael wrote:

  Date: Sun, 30 Jun 2002 14:02:47 -0700
  From: micael [EMAIL PROTECTED]
  Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
  To: Struts Users Mailing List [EMAIL PROTECTED]
  Subject: Re: Weird i18n Results -- i18n Experts Out There?
 
  I recently added the Japanese to the entire site with no issues.  I
  presently have English, Spanish, Italian, German, Portugese, French and
  Japanese working fine.  There is not a file on the site that has the
  results that I am getting, so it must be cached.  But, if it is cached,
  then how in the heck is it reading changes to the messages keys with
  English.  It is like it is reading some keys from this file and some other
  keys from a cache or another file.  Is that possible?
 

Struts follows the standard rules for the java.util.ResourceBundle class
to figure out which file to get messages from.  For example, if your
user's language preference (configured in the browser) is the zh_CN
locale, Struts will check for the existence of the message key in each of
these locales in sequence:

* zh_CN

* zh

* The default Locale for the JVM

Thus, it is quite possible for the messages on a particular page to end up
coming from different files.  The important thing is to match up you
filenames with the way that the browser is specifying them.

  Micael

Craig


 
  At 10:38 PM 6/30/2002 +0200, you wrote:
  Your browser-cache is cleaned too?
  
  
  Durk
  
I am building an i18n site.  I had a page with buttons that were in
Chinese, and have now change about half the text to Chinese.  That text
 still comes up in English.  I thought somehow the application was not
accessing the xxx_zh.properties file, so I changed a remaining English
key  value.  And, that changed in an accessing browser, so I know it is
 accessing that file.  Yet. it is coming up with English that is not
even on  the site anymore.  It must be cached somewhere.  However, I
shutdown  Tomcat, cleared the cache in TOMCAT_HOME/tomcat/work/ and
still get the  same results.  I have no idea what is going on.  I don't
even know what the  question is.  I seemingly cannot be a cache
problem, because changes to the  file are shown.  When I change a key
that has Chinese, that is not  reflected on the browser.  When I change
a key that has English, that is  reflected.  What in the Sam Hell is
going on?
   
Micael
   
   
   
--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED] For additional
commands, e-mail: mailto:[EMAIL PROTECTED]
  
  
  
  
  --
  To unsubscribe, 
 e-mail:   mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 
 
  --
  To unsubscribe, 
 e-mail:   mailto:[EMAIL PROTECTED]
  For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]
 
 


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n

2002-06-18 Thread James Mitchell

You'll have to restate your question with a little more clarity please.
I, personally, have no clue what it is you need.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://struts-atlanta.open-tools.org

  -Original Message-
  From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, June 18, 2002 11:52 AM
  To: Struts (E-mail)
  Subject: i18n


  Does anyone know how to get the data stored in value from de action
class?

  i18n:image
   pageproperty=buttonEditImage
   altProperty=buttonEditText
   property=action
   value=Edit_Coverage
   border=0/


  Thanks


  -Carlos.



RE: i18n

2002-06-18 Thread Carlos Fernandez

WEll, that code is placed in the JSP. It's a button. I want to know when the
button is pressed. Is that clear enough?

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 12:12 PM
To: Struts Users Mailing List
Subject: RE: i18n


You'll have to restate your question with a little more clarity please.
I, personally, have no clue what it is you need.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://struts-atlanta.open-tools.org

  -Original Message-
  From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, June 18, 2002 11:52 AM
  To: Struts (E-mail)
  Subject: i18n


  Does anyone know how to get the data stored in value from de action
class?

  i18n:image
   pageproperty=buttonEditImage
   altProperty=buttonEditText
   property=action
   value=Edit_Coverage
   border=0/


  Thanks


  -Carlos.

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n

2002-06-18 Thread James Mitchell

I'm assuming by your using the property=action, that you have a field on
your form for action (getAction() and setAction())

MyActionForm frm = (MyActionForm) form;
String action = frm.getAction()
if (action != null) {
  // insert code here
}

You might also look into the DispatchAction, its very easily implemented and
it can be a real timesaver.
See Chuck's book (Chapter 5 around page 23)
You can get review online at:
http://www.theserverside.com/resources/strutsreview.jsp




James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://struts-atlanta.open-tools.org

 -Original Message-
 From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 18, 2002 1:24 PM
 To: '[EMAIL PROTECTED]'
 Subject: RE: i18n


 WEll, that code is placed in the JSP. It's a button. I want to
 know when the
 button is pressed. Is that clear enough?


 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 18, 2002 12:12 PM
 To: Struts Users Mailing List
 Subject: RE: i18n


 You'll have to restate your question with a little more clarity please.
 I, personally, have no clue what it is you need.

 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://struts-atlanta.open-tools.org

   -Original Message-
   From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, June 18, 2002 11:52 AM
   To: Struts (E-mail)
   Subject: i18n


   Does anyone know how to get the data stored in value from de action
 class?

   i18n:image
pageproperty=buttonEditImage
altProperty=buttonEditText
property=action
value=Edit_Coverage
border=0/


   Thanks


   -Carlos.



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n

2002-06-18 Thread Carlos Fernandez

Nope. I will put it this way. I have 3 buttons un my JSP. Cancel, continue
and Edit. How do I know which button was pressed in my action class?. The
way how I implement the buttons is : 

   i18n:image
pageproperty=buttonEditImage
altProperty=buttonEditText
property=action
value=Edit_Coverage
border=0/

That example goes for the edit button.

-Carlos


-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 2:29 PM
To: Struts Users Mailing List
Subject: RE: i18n


I'm assuming by your using the property=action, that you have a field on
your form for action (getAction() and setAction())

MyActionForm frm = (MyActionForm) form;
String action = frm.getAction()
if (action != null) {
  // insert code here
}

You might also look into the DispatchAction, its very easily implemented and
it can be a real timesaver.
See Chuck's book (Chapter 5 around page 23)
You can get review online at:
http://www.theserverside.com/resources/strutsreview.jsp




James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://struts-atlanta.open-tools.org

 -Original Message-
 From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 18, 2002 1:24 PM
 To: '[EMAIL PROTECTED]'
 Subject: RE: i18n


 WEll, that code is placed in the JSP. It's a button. I want to
 know when the
 button is pressed. Is that clear enough?


 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 18, 2002 12:12 PM
 To: Struts Users Mailing List
 Subject: RE: i18n


 You'll have to restate your question with a little more clarity please.
 I, personally, have no clue what it is you need.

 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://struts-atlanta.open-tools.org

   -Original Message-
   From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, June 18, 2002 11:52 AM
   To: Struts (E-mail)
   Subject: i18n


   Does anyone know how to get the data stored in value from de action
 class?

   i18n:image
pageproperty=buttonEditImage
altProperty=buttonEditText
property=action
value=Edit_Coverage
border=0/


   Thanks


   -Carlos.



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n

2002-06-18 Thread micael

He wants to know how to get Edit Coverage from the action.

At 02:00 PM 6/18/2002 -0400, you wrote:
WEll, that code is placed in the JSP. It's a button. I want to know when the
button is pressed. Is that clear enough?

-Original Message-
From: James Mitchell [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 12:12 PM
To: Struts Users Mailing List
Subject: RE: i18n


You'll have to restate your question with a little more clarity please.
I, personally, have no clue what it is you need.

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the Open Minded Developer Network
http://struts-atlanta.open-tools.org

   -Original Message-
   From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, June 18, 2002 11:52 AM
   To: Struts (E-mail)
   Subject: i18n


   Does anyone know how to get the data stored in value from de action
class?

   i18n:image
pageproperty=buttonEditImage
altProperty=buttonEditText
property=action
value=Edit_Coverage
border=0/


   Thanks


   -Carlos.

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n

2002-06-18 Thread Joseph Barefoot

You can put it however you like, but if you don't have a getAction() and
setAction() as James describes, then the value Edit Coverage will never be
stored anywhere.  Add these to your form and then retrieve the value from
the form bean associated with your action class as he also described, and
match the value to determine the action.

Or you can retrieve it directly from the request (i.e.
request.getParameter(action)), if you want to break Struts MVC concepts.

Or, finally, you can use a different property name (e.g. editAction,
cancelAction, continueAction) for each of the buttons (and add getter/setter
pairs for these properties to the form bean), and then it doesn't matter
what the value attribute is set to.  Just check to see which of the three
properties (form fields) has a value instead.  The one that isn't null will
be the one that was clicked.


peace,
Joe

 -Original Message-
 From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 18, 2002 11:38 AM
 To: 'Struts Users Mailing List'
 Subject: RE: i18n


 Nope. I will put it this way. I have 3 buttons un my JSP. Cancel, continue
 and Edit. How do I know which button was pressed in my action class?. The
 way how I implement the buttons is :

i18n:image
 pageproperty=buttonEditImage
 altProperty=buttonEditText
 property=action
 value=Edit_Coverage
 border=0/

 That example goes for the edit button.

 -Carlos


 -Original Message-
 From: James Mitchell [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, June 18, 2002 2:29 PM
 To: Struts Users Mailing List
 Subject: RE: i18n


 I'm assuming by your using the property=action, that you have a field on
 your form for action (getAction() and setAction())

 MyActionForm frm = (MyActionForm) form;
 String action = frm.getAction()
 if (action != null) {
   // insert code here
 }

 You might also look into the DispatchAction, its very easily
 implemented and
 it can be a real timesaver.
 See Chuck's book (Chapter 5 around page 23)
 You can get review online at:
 http://www.theserverside.com/resources/strutsreview.jsp




 James Mitchell
 Software Engineer\Struts Evangelist
 Struts-Atlanta, the Open Minded Developer Network
 http://struts-atlanta.open-tools.org

  -Original Message-
  From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, June 18, 2002 1:24 PM
  To: '[EMAIL PROTECTED]'
  Subject: RE: i18n
 
 
  WEll, that code is placed in the JSP. It's a button. I want to
  know when the
  button is pressed. Is that clear enough?
 
 
  -Original Message-
  From: James Mitchell [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, June 18, 2002 12:12 PM
  To: Struts Users Mailing List
  Subject: RE: i18n
 
 
  You'll have to restate your question with a little more clarity please.
  I, personally, have no clue what it is you need.
 
  James Mitchell
  Software Engineer\Struts Evangelist
  Struts-Atlanta, the Open Minded Developer Network
  http://struts-atlanta.open-tools.org
 
-Original Message-
From: Carlos Fernandez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 18, 2002 11:52 AM
To: Struts (E-mail)
Subject: i18n
 
 
Does anyone know how to get the data stored in value from de action
  class?
 
i18n:image
 pageproperty=buttonEditImage
 altProperty=buttonEditText
 property=action
 value=Edit_Coverage
 border=0/
 
 
Thanks
 
 
-Carlos.
 


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n and images?

2002-06-10 Thread Roman Rytov

Hi Elizabeth!

You got my point. But encripting images goes far from my simple request. All I'm 
looking for is ability to store image path and its alt in a property file. Such files 
on my assumption should be localized (exactely as message resources). Did I understand 
right that at the time being there is nothing in Struts like this?

-Original Message-
From: Elizabeth Barham [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 11:13
To: Roman Rytov
Subject: Re: i18n and images?


[ Not on the struts-user mailing list because this message does not
directly relate to struts ]

Roman Rytov [EMAIL PROTECTED] writes:
 Is there any way to store image related info into a property file
 and hardcode not an image location but its alias from this file? I
 think smth. should exist for this purpose.

Hi Roman,

If I understand you correctly, yes, I agree that it is a good idea.

As for a way to do it, I suppose it could be done any number of ways.
My first attempt at it was by storing images in a database with the
MD5 of the image itself being it's primary key, along with data about
the image itself. From within a jsp page, for example, something like:

spec:img key=359aa1fbe4154ef7492760c63a09e79e662efd7d/

could be called, which fetches the meta-information from the database
and replaces the spec:img tag with something like:

img src=http://photoserver.your.com/359aa1fbe4154ef7492760c63a09e79e662efd7d.jpeg;
 alt=Picture of a pretty tree
 height=210
 width=50
/

In this case, the photo is fetched off of a file system which is the
direction I'm currently going with it but originally it was designed
as a cgi-bin program that pumps the image data to the browser. The
alt is fetched from the database, along with the height and width.
The suffix to the filename is determined from mime-type stored in the
database.

It would be possible to do things like:

spec:img key=359aa1fbe4154ef7492760c63a09e79e662efd7d
  scale=5:1
/

This doesn't directly involve struts, though. However, I'm planning on
implimenting a photo catalog system using struts, which allows users
to upload photos. Then an SHA-256 message digest is made of the data,
and meta-information is associated with the image itself (such as
photographer, classification, and description) is gathered from the
user. Some have stated that using the SHA-256 message digest algorithm
in this fashion is disasterous but I disagree. It seems like a
wonderful way to insure photograph uniqueness.

Is this the type of thing you have in mind? I like your idea of the
property file especially in regards to locales - that would be super
if the Alt tag could produce messages in different languages.

Elizabeth

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n and images?

2002-06-10 Thread Yaman Kumar

Hi,
If I understand your question properly, keep all images of application in a
dir
and write these images names in properties file(i18n_*.properties)
with key names and in jsp page call that key name.

Example.
suppose you need to display an image (x1.gif) for en locale
and other image(x2.gif) for fr locale.
then in your properties file Application resources or I18N props file)
In *_en.properties maintain a key sampleImage = x1.gif,
In *_fr.properties maintain a key sampleImage = x2.gif.

and in your jsp call img src=images/bean:message key='sampleImage'/ 
to render it in page.

HTH
TIA
rayaku


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n and images?

2002-06-10 Thread Roman Rytov

I agree that this is a solution. But don't forget I need to store also tips (alt's 
attribute values) for every image hence I need a second file. Two drawbacks arose: 
synchronization between files is up to me and the code becomes ugly:

img src=images/bean:message key='sampleImage'/ alt=bean:message 
key='alt.sampleImage'/
 
But I agree it's better than nothing.




-Original Message-
From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 11:47
To: Struts Users Mailing List
Subject: RE: i18n and images?


Hi,
If I understand your question properly, keep all images of application in a
dir
and write these images names in properties file(i18n_*.properties)
with key names and in jsp page call that key name.

Example.
suppose you need to display an image (x1.gif) for en locale
and other image(x2.gif) for fr locale.
then in your properties file Application resources or I18N props file)
In *_en.properties maintain a key sampleImage = x1.gif,
In *_fr.properties maintain a key sampleImage = x2.gif.

and in your jsp call img src=images/bean:message key='sampleImage'/ 
to render it in page.

HTH
TIA
rayaku


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n and images?

2002-06-10 Thread Vikram Goyal01

Why do you need a separate file for tips?

In the same file:
sampleImage.tip = My Tip

and access it via the key sampleImage.tip





-Original Message-
From: Roman Rytov [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 2:26 PM
To: Struts Users Mailing List
Subject: RE: i18n and images?


I agree that this is a solution. But don't forget I need to store also tips (alt's 
attribute values) for every image hence I need a second file. Two drawbacks arose: 
synchronization between files is up to me and the code becomes ugly:

img src=images/bean:message key='sampleImage'/ alt=bean:message 
key='alt.sampleImage'/
 
But I agree it's better than nothing.




-Original Message-
From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 11:47
To: Struts Users Mailing List
Subject: RE: i18n and images?


Hi,
If I understand your question properly, keep all images of application in a
dir
and write these images names in properties file(i18n_*.properties)
with key names and in jsp page call that key name.

Example.
suppose you need to display an image (x1.gif) for en locale
and other image(x2.gif) for fr locale.
then in your properties file Application resources or I18N props file)
In *_en.properties maintain a key sampleImage = x1.gif,
In *_fr.properties maintain a key sampleImage = x2.gif.

and in your jsp call img src=images/bean:message key='sampleImage'/ 
to render it in page.

HTH
TIA
rayaku


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n and images?

2002-06-10 Thread Kristopher Brown

Hope I'm not missing the point, but I think the standard struts html:img tag covers 
this already with the altKey attribute and the srcKey or pageKey attribute.

 -Original Message-
 From: Roman Rytov [mailto:[EMAIL PROTECTED]]
 Sent: 10 June 2002 09:56
 To: Struts Users Mailing List
 Subject: RE: i18n and images?
 
 
 I agree that this is a solution. But don't forget I need to 
 store also tips (alt's attribute values) for every image 
 hence I need a second file. Two drawbacks arose: 
 synchronization between files is up to me and the code becomes ugly:
 
 img src=images/bean:message key='sampleImage'/ 
 alt=bean:message key='alt.sampleImage'/
  
 But I agree it's better than nothing.
 
 
 
 
 -Original Message-
 From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 10, 2002 11:47
 To: Struts Users Mailing List
 Subject: RE: i18n and images?
 
 
 Hi,
 If I understand your question properly, keep all images of 
 application in a
 dir
 and write these images names in properties file(i18n_*.properties)
 with key names and in jsp page call that key name.
 
 Example.
 suppose you need to display an image (x1.gif) for en locale
 and other image(x2.gif) for fr locale.
 then in your properties file Application resources or I18N props file)
 In *_en.properties maintain a key sampleImage = x1.gif,
 In *_fr.properties maintain a key sampleImage = x2.gif.
 
 and in your jsp call img src=images/bean:message 
 key='sampleImage'/ 
 to render it in page.
 
 HTH
 TIA
 rayaku
 
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n and images?

2002-06-10 Thread Roman Rytov

Wow! Finally one pointed me at what I was asking for:-)) Thanks!

-Original Message-
From: Kristopher Brown [mailto:[EMAIL PROTECTED]]
Sent: Monday, June 10, 2002 12:03
To: Struts Users Mailing List
Subject: RE: i18n and images?


Hope I'm not missing the point, but I think the standard struts html:img tag covers 
this already with the altKey attribute and the srcKey or pageKey attribute.

 -Original Message-
 From: Roman Rytov [mailto:[EMAIL PROTECTED]]
 Sent: 10 June 2002 09:56
 To: Struts Users Mailing List
 Subject: RE: i18n and images?
 
 
 I agree that this is a solution. But don't forget I need to 
 store also tips (alt's attribute values) for every image 
 hence I need a second file. Two drawbacks arose: 
 synchronization between files is up to me and the code becomes ugly:
 
 img src=images/bean:message key='sampleImage'/ 
 alt=bean:message key='alt.sampleImage'/
  
 But I agree it's better than nothing.
 
 
 
 
 -Original Message-
 From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 10, 2002 11:47
 To: Struts Users Mailing List
 Subject: RE: i18n and images?
 
 
 Hi,
 If I understand your question properly, keep all images of 
 application in a
 dir
 and write these images names in properties file(i18n_*.properties)
 with key names and in jsp page call that key name.
 
 Example.
 suppose you need to display an image (x1.gif) for en locale
 and other image(x2.gif) for fr locale.
 then in your properties file Application resources or I18N props file)
 In *_en.properties maintain a key sampleImage = x1.gif,
 In *_fr.properties maintain a key sampleImage = x2.gif.
 
 and in your jsp call img src=images/bean:message 
 key='sampleImage'/ 
 to render it in page.
 
 HTH
 TIA
 rayaku
 
 
 --
 To unsubscribe, e-mail:   
mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n and images?

2002-06-10 Thread timw

Would you please give me the exact syntax? What if I want to use this image 
as a submit button?

Thanks very much. 

Tim 

Kristopher Brown writes: 

 Hope I'm not missing the point, but I think the standard struts html:img tag covers 
this already with the altKey attribute and the srcKey or pageKey attribute. 
 
 -Original Message-
 From: Roman Rytov [mailto:[EMAIL PROTECTED]]
 Sent: 10 June 2002 09:56
 To: Struts Users Mailing List
 Subject: RE: i18n and images? 
 
 
 I agree that this is a solution. But don't forget I need to 
 store also tips (alt's attribute values) for every image 
 hence I need a second file. Two drawbacks arose: 
 synchronization between files is up to me and the code becomes ugly: 
 
 img src=images/bean:message key='sampleImage'/ 
 alt=bean:message key='alt.sampleImage'/
  
 But I agree it's better than nothing. 
 
  
 
 
 -Original Message-
 From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 10, 2002 11:47
 To: Struts Users Mailing List
 Subject: RE: i18n and images? 
 
 
 Hi,
 If I understand your question properly, keep all images of 
 application in a
 dir
 and write these images names in properties file(i18n_*.properties)
 with key names and in jsp page call that key name. 
 
 Example.
 suppose you need to display an image (x1.gif) for en locale
 and other image(x2.gif) for fr locale.
 then in your properties file Application resources or I18N props file)
 In *_en.properties maintain a key sampleImage = x1.gif,
 In *_fr.properties maintain a key sampleImage = x2.gif. 
 
 and in your jsp call img src=images/bean:message 
 key='sampleImage'/ 
 to render it in page. 
 
 HTH
 TIA
 rayaku 
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED] 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED] 
 
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED] 
 
 









Free Email  DynDNS @ www.zeropain.com 
Get your website hosted with zeropain.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: i18n and images?

2002-06-10 Thread timw

Sorry one more question:

If I want to specify width and height of the image, how should I do it? 

Would you please give me the exact syntax? What if I want to use this image 
as a submit button? 

Thanks very much. 

Tim 


 Kristopher Brown writes:  
 
 Hope I'm not missing the point, but I think the standard struts html:img 
 tag covers this already with the altKey attribute and the srcKey or 
 pageKey attribute.  
 
 -Original Message-
 From: Roman Rytov [mailto:[EMAIL PROTECTED]]
 Sent: 10 June 2002 09:56
 To: Struts Users Mailing List
 Subject: RE: i18n and images?  
 
 
 I agree that this is a solution. But don't forget I need to store also 
 tips (alt's attribute values) for every image hence I need a second 
 file. Two drawbacks arose: synchronization between files is up to me and 
 the code becomes ugly:  
 
 img src=images/bean:message key='sampleImage'/ alt=bean:message 
 key='alt.sampleImage'/
 But I agree it's better than nothing.  
 
   
 
 
 -Original Message-
 From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 10, 2002 11:47
 To: Struts Users Mailing List
 Subject: RE: i18n and images?  
 
 
 Hi,
 If I understand your question properly, keep all images of application 
 in a
 dir
 and write these images names in properties file(i18n_*.properties)
 with key names and in jsp page call that key name.  
 
 Example.
 suppose you need to display an image (x1.gif) for en locale
 and other image(x2.gif) for fr locale.
 then in your properties file Application resources or I18N props file)
 In *_en.properties maintain a key sampleImage = x1.gif,
 In *_fr.properties maintain a key sampleImage = x2.gif.  
 
 and in your jsp call img src=images/bean:message key='sampleImage'/ 
 
 to render it in page.  
 
 HTH
 TIA
 rayaku  
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]  
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]  
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]  
 
  
 
  
 
  
 
  
 
  
 
 Free Email  DynDNS @ www.zeropain.com Get your website hosted with 
 zeropain.com 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED] 
 
 









Free Email  DynDNS @ www.zeropain.com 
Get your website hosted with zeropain.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: i18n and images?

2002-06-10 Thread Julian Trott

Hi,

If you want to submit the form use the html:image tag, but you cannot specify the 
width and height.

Check out the documentation at 
http://jakarta.apache.org/struts/userGuide/struts-html.html#image

Regards

Julian

-Original Message-
From: timw [mailto:[EMAIL PROTECTED]]
Sent: 10 June 2002 14:52
To: Struts Users Mailing List
Subject: Re: i18n and images?


Sorry one more question:

If I want to specify width and height of the image, how should I do it? 

Would you please give me the exact syntax? What if I want to use this image 
as a submit button? 

Thanks very much. 

Tim 


 Kristopher Brown writes:  
 
 Hope I'm not missing the point, but I think the standard struts html:img 
 tag covers this already with the altKey attribute and the srcKey or 
 pageKey attribute.  
 
 -Original Message-
 From: Roman Rytov [mailto:[EMAIL PROTECTED]]
 Sent: 10 June 2002 09:56
 To: Struts Users Mailing List
 Subject: RE: i18n and images?  
 
 
 I agree that this is a solution. But don't forget I need to store also 
 tips (alt's attribute values) for every image hence I need a second 
 file. Two drawbacks arose: synchronization between files is up to me and 
 the code becomes ugly:  
 
 img src=images/bean:message key='sampleImage'/ alt=bean:message 
 key='alt.sampleImage'/
 But I agree it's better than nothing.  
 
   
 
 
 -Original Message-
 From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
 Sent: Monday, June 10, 2002 11:47
 To: Struts Users Mailing List
 Subject: RE: i18n and images?  
 
 
 Hi,
 If I understand your question properly, keep all images of application 
 in a
 dir
 and write these images names in properties file(i18n_*.properties)
 with key names and in jsp page call that key name.  
 
 Example.
 suppose you need to display an image (x1.gif) for en locale
 and other image(x2.gif) for fr locale.
 then in your properties file Application resources or I18N props file)
 In *_en.properties maintain a key sampleImage = x1.gif,
 In *_fr.properties maintain a key sampleImage = x2.gif.  
 
 and in your jsp call img src=images/bean:message key='sampleImage'/ 
 
 to render it in page.  
 
 HTH
 TIA
 rayaku  
 
 
 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]  
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]  
 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED]  
 
  
 
  
 
  
 
  
 
  
 
 Free Email  DynDNS @ www.zeropain.com Get your website hosted with 
 zeropain.com 
 
 --
 To unsubscribe, e-mail:   
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: 
 mailto:[EMAIL PROTECTED] 
 
 

















Free Email  DynDNS @ www.zeropain.com 

Get your website hosted with zeropain.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: I18N

2002-04-10 Thread Oliver Refle

I don't know if i understand the question correctly,
but if you want to enable the user to select the displayed
language, you only have to change the locale which ist
stored in the session

request.getSession().setAttribute(Action.Locale,new Locale(FR,fr));

the Action is the class form struts, and the locale simply uses ISO Code
Then you only have to provide the ApplicationRessources_fr.properties
and then you have enabled the user to select his locale

Oliver

-Original Message-
From: Jefferson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 4:48 AM
To: Struts Users Mailing List
Subject: Re: I18N


the second one (changing the reference from an english
properties file to a portuguese properties file

Jefferson


Louis Leung wrote:

 do u mean changing the propertises of a properties file from english to
 portuguese ?  or do u mean changing the reference from an english
propertises
 file to a portuguese propertises file ?

 Jefferson Rodrigues de Oliveira e Silva wrote:

  Hi guys,
 
  I have a problem with I18N... how can I change my properties file from
  english to, let's say, portuguese, during execution time ? I want to
  allow the
  user to change it in the site ...
 
  Thanks a lot
  Best regards,
 
  Jefferson
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: I18N

2002-04-09 Thread Louis Leung

do u mean changing the propertises of a properties file from english to
portuguese ?  or do u mean changing the reference from an english propertises
file to a portuguese propertises file ?

Jefferson Rodrigues de Oliveira e Silva wrote:

 Hi guys,

 I have a problem with I18N... how can I change my properties file from
 english to, let's say, portuguese, during execution time ? I want to
 allow the
 user to change it in the site ...

 Thanks a lot
 Best regards,

 Jefferson

 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




  1   2   >