aspose file tools*
The moose likes Spring and the fly likes Default encoding in spring. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Default encoding in spring." Watch "Default encoding in spring." New topic
Author

Default encoding in spring.

pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 413

I have seen the following code to set default-encoding in spring:



But can any body tell me how to it in following pattern:



I have tried p:defaultEncoding="UTF-8" but it does not work.


Pawan Chopra
SCJP - DuMmIeS mInD
Brian Murphy
Author
Greenhorn

Joined: Jul 07, 2010
Posts: 8
Hey Pawan,

Do you get an error of some sort? The syntax you're suggesting does indeed work. Here's what it would look like.



Also note that you have to use unicode escapes to get UTF-8 support, or switch to using the XML format for message bundles. You can read more in the Properties JavaDocs - http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/api/java/util/Properties.html

Cheers,

Brian D. Murphy
@brimurph
pawan chopra
Ranch Hand

Joined: Jan 23, 2008
Posts: 413

Sorry Brian....We were busy in some other work for 2 months. So couldn't look into it. now I ahve got the solution thanks to you. What I have noticed that with ReloadableResourceBundleMessageSource class we have to put classpath as prefix with basename property. This was the only problem. Thanks once again and sorry for such a late reply.
 
 
subject: Default encoding in spring.