Resource bundles and sort order?

I am wanting to use a resource bundle to store entries that can then be displayed sorted in a combo-box component in an HTML page, though it does not seem to be working out. Basically I am using JSTL and Struts2, and the select component can take various collection types including a Map. As an alternative I tried using a properties file, but this has two issues:
- I loose the locale resolution mechanism provided by ResourceBundle
- The order in which the entries appeared in the file is lost (it does not inherit from LinkedHashMap)
What approach would you recommend to loading a localised list and then ensure it displays in the order of the display values. I looked around the net, but I am yet to find anything of use.

If you want to have default values, I would suggest using ResourceBundles and just sending in a Locale with the variant of the company. That way if your application ever needs to be localized it won't take much to change it. Your properties files would be named baseName_languageCode_CountryCode_Variant.properties.
It has been a great advantage for the program that I am developing.

Similar Messages

  • Resource Bundles and Locales

    Hi!!
    I am researching Resource Bundles and how they work and have a question. Do you have to use Locales to determine which bundle to use? You see I am developing a product that will only be used in the US but will be used by several different companies. I would like to use a resource bundle for each company instead of for each country!! Is this possible? and if it is, how?
    Thanks for your time

    If you want to have default values, I would suggest using ResourceBundles and just sending in a Locale with the variant of the company. That way if your application ever needs to be localized it won't take much to change it. Your properties files would be named baseName_languageCode_CountryCode_Variant.properties.
    It has been a great advantage for the program that I am developing.

  • How to show the columns (and sequence and sort order) of an INDEX?

    Assume I have an INDEX for an existing TABLE.
    How can I find out the columns covered by this INDEX (and the sequence and sort order)?
    Which table contains this information?
    all_indexes does not.
    Peter

    user559463 wrote:
    Assume I have an INDEX for an existing TABLE.
    How can I find out the columns covered by this INDEX (and the sequence and sort order)?
    Which table contains this information?
    all_indexes does not.
    Peter--
    select table_name, index_name, column_name, column_position
    from user_ind_columns
    order by table_name, index_name, column_position;

  • Russian and English combined Index Group Title and sort order

    How should I create the combined index Group Title and sort order in Russian and Greek documentations?

    The final product one Russian manual which contains some English Index marker ...
    And what is the problem?
    You can control the sorting by placing a [...] tag in the Marker Text, such as:
    [Сплайн] Spline
    The term(s) in the brackets are used only for sort. What appears in the Index is the following text.
    Or you can just edit the Marker Text.
    But it sounds like there might be more than one question here, re: Group Titles.

  • Resource Bundles and Embedded fonts - best practice

    Hello,
    I am in digging into creating a localized app and I would
    like to use embedded fonts.
    Ideally, I would like to have two locales (for example), each
    with a different embedded font and/or unicode range.
    For example, how do I set up my localized app so that EN uses
    Arial (Latin Range), and JP uses Arial Unicode MS with Japanese
    Kanji unicode range ?
    Note that I do know how to embed fonts with different ranges,
    I just don't know how to properly embed them into resource bundles
    and access them easily in style sheets.
    Thanks!
    -Daniel

    Hello!
    This is a very pertinent question, however as many things in life there is no one size fits all here.
    We basically recommend, as best practice, to allocate for each specific context only the estimated needed resources. These values should always come from a previous study on the network patterns/load.
    To accomodate for growth and scalability it is strongly advised to initially keep as many resources reserved as possible and allocate the unused resources as needed. To accomplish this goal, you should created a reserved resource class, as you did already, with a guarantee of 20 to 40 percent of all ACE resources and configure a virtual context solely with the purpose of ensuring that these resources are reserved.
    As you might already know ACE protects resources in use, this means that when decreasing a context's resources, the resources must be unused before then can be reused by other context. Although it is possible to decrease the resource allocations in real time, it typically requires additional overhead to clear any used resources before reducing them.
    Based on the traffic patterns, number of connections, throughput, concurrent SSL connections , etc, for each of the sites you will be deploying you will have a better idea on what might be the estimated needed resources and then assign them to each of the contexts. Thus this is something that greatly depends on customer's network environment.
    Hope this helps to clarify your doubts.

  • [svn:fx-trunk] 12663: Adding the resource bundle and fat-swc targets for osmf and textlayout.

    Revision: 12663
    Revision: 12663
    Author:   [email protected]
    Date:     2009-12-08 12:22:31 -0800 (Tue, 08 Dec 2009)
    Log Message:
    Adding the resource bundle and fat-swc targets for osmf and textlayout.  Also for osmf adding the doc target.  This new format that I added to the two project build files will be what we will use going forward for all projects.  I have all the other projects modified and plan on checking them in soon.  The format change will make adding new locales easier as well as adding the fat-swc target when needed.
    QE notes: no
    Doc notes: no
    Bugs: no
    Reviewer: gaurav
    Tests run: checkintests
    Is noteworthy for integration: no
    Modified Paths:
        flex/sdk/trunk/frameworks/build.xml
        flex/sdk/trunk/frameworks/projects/osmf/build.xml
        flex/sdk/trunk/frameworks/projects/textLayout/build.xml
    Added Paths:
        flex/sdk/trunk/frameworks/projects/osmf/bundles/
        flex/sdk/trunk/frameworks/projects/osmf/bundles/en_US/
        flex/sdk/trunk/frameworks/projects/osmf/bundles/en_US/osmf.properties
        flex/sdk/trunk/frameworks/projects/textLayout/bundles/en_US/textLayout.properties
    Removed Paths:
        flex/sdk/trunk/frameworks/projects/osmf/src/OSMFDocClasses.as
        flex/sdk/trunk/frameworks/projects/textLayout/bundles/en_US/empty.properties

    Thats good news.

  • Resource Bundle and encoding

    Hi,
    I'm too confused abt the encoding stuff that java does. First of all, I have a resource bundle written in chinese (Big5), in my program I've used getString(key) to retrieve the corresponding value to be displayed on the html page. I've got a few questions.
    1) From what I've understand, String is always in Unicode. Does that mean that when the string I've retrieved from Resource Bundle is converted to Unicode?
    2) When I do String a = ResourceBundle.getString(key), in order to display the correct Chinese character, I should do new String(a.getBytes("Big5")), right?? But i've got some weird characters. Why?
    3) It will work if I use new String(a.getBytes(), "Big5").
    I know that if I use a.getBytes(), it will return me bytes[] encoded using the system default encoding (in my case, Cp1252). But why is it returning me the correct string since my Resource Bundle is written in "Big5"? Or will getString(key) do some encoding?
    4) It will also work if I use this:
    BufferedReader reader = new BufferedReader(new InputStreamReader(new StringBufferInputStream(a),"Big5"));
    the display will be correct, why is this so? Is there any other class besides StringBufferInputStream as it is deprecated.
    I've been researching on this encoding topic for quite some time but didn't manage to understand it at all. Please help!! Thanks!

    Hi,
    I'm too confused abt the encoding stuff that java
    does. First of all, I have a resource bundle written
    in chinese (Big5), in my program I've used
    getString(key) to retrieve the corresponding value to
    be displayed on the html page. I've got a few
    questions.PropertyResourceBundles should be converted using the native2ascii tool. ListResourceBundles should be compiled with the -encoding flag. In your case:
    1. native2ascii -encoding Big5 resource.txt bundle.properties, or
    2. javac -encoding Big5 bundle.java
    >
    1) From what I've understand, String is always in
    Unicode. Does that mean that when the string I've
    retrieved from Resource Bundle is converted to
    Unicode?Once you have compiled the ResourceBundle, all text objects are represented as Unicode. Your retrieved String is Unicode text.
    2) When I do String a = ResourceBundle.getString(key),
    in order to display the correct Chinese character, I
    should do new String(a.getBytes("Big5")), right?? But
    i've got some weird characters. Why?No, you should not try to convert the String further. You have a perfectly good Unicode String at that point. You have weird characters after the above operation because you are converting Big5 text to a Unicode String using the default charset on your host...which may not be Big5 at all. In fact, it is not Big5 since you say you see strange characters.
    3) It will work if I use new String(a.getBytes(),
    "Big5").
    I know that if I use a.getBytes(), it will return me
    bytes[] encoded using the system default encoding (in
    my case, Cp1252). But why is it returning me the
    correct string since my Resource Bundle is written in
    "Big5"? Or will getString(key) do some encoding?Do not convert the String. Your operations with getBytes and new String() are an attempt to recreate the original String...which you already have...it is unnecessary.
    4) It will also work if I use this:
    BufferedReader reader = new BufferedReader(new
    InputStreamReader(new
    StringBufferInputStream(a),"Big5"));
    the display will be correct, why is this so? Is there
    any other class besides StringBufferInputStream as it
    is deprecated.Do not convert the String. It is already usable.
    >
    I've been researching on this encoding topic for quite
    some time but didn't manage to understand it at all.
    Please help!! Thanks!String a = bundle.getString(SOME_KEY);
    component.setText(a);
    This should be sufficient to retrieve and display the text, assuming all else is correct.
    Regards,
    John O'Conner

  • Aperture, the iPad, and sort order

    Basically, Aperture and iPad really don't seem to be happy bed buddies. Seems to me the bottom line is if you want to use your iPad to browse and view pictures, don't "upgrade" to Aperture.
    My basic problem is sort order, and twofold:
    1. The order of Albums and Events (ie. Projects) are completely out of whack.
    2. The order of actual photos in albums and events are completely out of whack too.
    Now I've seen complaints about 2. in the discussions but they seem to be pretty old threads and everyone's seemed to just have lived with it. I also see this support article: http://support.apple.com/kb/TS3381. Seriously? Apple calls that a "Resolution"? Manually dragging a photo in each and every album / project so that it uses the custom sort? Then of course on top of all that monkey work, the sort will be screwed for any future photos added to the album / project. ***? You can't even call that a workaround, let alone a resolution. Seriously Apple. Has anyone had any better luck with it?
    This has been a pain in the *** with A2 and the iPhone but I didn't really use that too much to display my photos. But now with A3 and iPad, it's still exactly the same deal? This is just plain stupid.
    As to 1. I can't for the life of me figure out what this order is (it's not by date or by name / path or anything I can tell), or if there's any way to change it. Nor could I find any threads about this issue so any info or tips would be very useful.
    I really hate that all this iDevice syncing has solely been designed for use with iPhoto/iLife and the pro applications were just tacked on as a badly implemented afterthought. Is the pro market (specifically the intersection of Pro software and iDevice users) really this small that it means nothing to Apple, a company which normally prides itself in its attention to detail and user experience?

    After taking a breath I renamed "version name" using the batch change function (you can select to keep the original file name untouched if you want) with a custom name as following:
    <Image Date> at <Image Time> - <Version Name> (optional as a reference to the original file name)
    synched with ipad and everything is fine now. takes only 30 sec. still annoying you have to go through these extra loops though...

  • Special carater and sort order...

    I have a problem with a field varchar2... my field contains
    specail caracter such '.*' when I request sort order by this
    field there is a problem with order... the sort order is not
    correct...

    Hello,
    Excuse me ...
    I have the NLS_SORT set to BINARY and NLS_LANGAUNGE to
    AMERICAN...
    I do this request:
    Select * from fournisseur where rais<='A. BOET' order by rais
    DESC
    The result is:
    NFOU RAIS
    ======== =========
    6232 A. BOET
    775 2 PC
    That's show that '2 PC ' is great than 'A. BOET' but the
    condition was "where rais<='A. BOET" so '2 PC should not be
    selected in the query.
    For information if I add one space before the number in the rais
    for "2 PC" ----> " 2 PC" in the table the problem does'nt
    exist....
    Please help....

  • [ Previous]  [Next ]  and Sort Order

    Is there a way to make HTMLDB generate report and edit form in such way that [< Previous] [Next>] sequence on follows the reports SORT ORDER instead of PK ?
    e.g. a report on EMP and user sort on HIREDATE...
    so when user gets linked to Edit Form page and click Previous/Next buttons - the USER, totally oblivious to PK - from his perspective, he expects to see [< Previous], [Next>] brings up the Previous/Next record PER SORT ORDER

    Robert - I think it's supposed to work the way you
    want it to. Are you using the column sort options on
    the report attributes page?Scott,
    No, it's not doing that...
    Just now generated app on EMP - all default except no aggregations and sum to keep it simple.
    Test#1)
    Click HIREDATE column to sort DESC.
    KING
    MARTIN
    TURNER
    Click MARTIN record to edit. PREV/NEXT follows EMPNO order
    JONES
    MARTIN
    BLAKE
    Test#2) went into "Report Attributes"
    Under "Sort": Uncheck all except HIREDATE and made
    "Sort Sequence" = '1 desc'
    Result is same as Test#1
    http://htmldb.oracle.com/pls/otn/f?p=24949:1

  • Resource Bundle and EJB

    Hi All,
    Has anyone tried successfully loading a ResourceBundle properties file from within a EJB? I need to localize messages based on user locale. Hence the need for ResourceBundle.
    I read about set the EJB classloader's classpath with a reference to the resource bundle, but I don't know how and where to do this...
    Any help appreciated.
    Thanks and regards!

    Hi all,
    First, thanks all for your answers!! The suggestion from Warnerja has worked. I did packaged the resource files into a .jar file and imported it into my Enterprise App. Thus, I did make a reference in both web project and ejb project.
    Hello Dhinojosa, in answer to your question, my project objectives is provide full internationalization support to my application. My doubt is how to implement internationalization support on an application composed by one Web app project one Ejb project and both tiers have to access the resources...
    Thanks and regards,
    Flor.

  • Album Info and Sort Order?

    Two Questions really, both of which I think (I hope!) are just me not quite getting the interface:
    1) In iPhoto an album can have comments associated with the it. I tended to put in notes that related to all the pictures in the album, when I did the import from iPhoto I can't seem to find these album comments anywhere, I can only get the inspector to show a given image version info.
    2) When looking at the listing of albums on the left I have them in folders by year 2001, 2002, etc. Within each folder everything seems to be alphabetical - if I have albums called:
    "A Album 2005-10-05" and "B Album 2005-01-10" then A comes before B and they are not in the proper order. Is there anyway to tell the Aperture to either:
    - Sort in date order?
    - Don't sort at all and allow me to just drag and place the albums in whatever order I want?
    I know I can rename my albums to have the date info at the start of the album in order to get this to work, but I don't really have a ton of motivation to do that for hundreds of albums. I guess a third question is if there would be some useful way to automate that?

    I had the same issue. I compared the "get info" for two songs from the same U2 album, and the difference in my case was that the song from group A had U2 listed as the album artist. Song B was in a different group and that field was blank. I typed U2 into that field, and voila! The wayward songs migrated into the correct album.

  • ITunes 11 Recently Added and Sorting Order

    Upon updating to iTunes 11 last week, I've found that my Recently Added playlist is completely out of order both on my iPhone 4 and in iTunes on my Mac.
    The playlist is now set to sort by artist name, not the date that the songs were added. Ordinarily, I would just switch my display to "Sort by: Date Added." However, when I do this, the tracks within each album are now listed alphabetically, rather than being listed in track order. Towards the bottom of my playlist, songs aren't even sorted by album anymore - three albums are completely mixed up, because I purchased them at the same time.
    When I view this album on my iPhone, the same problem occurs. The songs are listed in the order that I downloaded the album, but the songs within the album are either in a random order (probably the order in which the songs finished downloading) or they are listed alphabetically. This did NOT happen prior to downloading iTunes 11.
    To summarize: I can get the songs listed in the correct track order if I sort by artist, but then the albums are not sorted by date added. I can get the albums sorted by date added, but then the tracks are not sorted in correct track order.
    What I would love is for the playlist to show the most recent album that I downloaded, with the tracks in the correct order. In other words:
    Most Recent Album
         Track 1
         Track 2
         Track 3
    Next Most Recent Album
         Track 1
         Track 2
         Track 3
    Is this possible?

    For reference...
    In this image, you can see that the playlist is sorting by artist, and within each album, the tracks are in the correct order.
    In this next image, you will see that I have sorted the playlist by "Date Added." When I do this, the "Sleeping with Sirens" album is in REVERSE alphabetical order (because it's ascending, not descending), not reverse track order. The albums near the top of the playlist are completely jumbled up.
    Prior to updating to iTunes 11, the playlist worked wonderfully. The far-left column (the one that is selected in the first photo) was selected, and it would list all of my songs in the manner I outlined in the first post (albums by date added, with track order intact) and all was well. I am wondering if it is possible to get that again, or, if not, why?

  • How to quickly find purchases and sort order of songs?

    I just purchased an entire album and some random songs from another artist. First of all, what's the quickest way to access my purchases? Nextly (word?) how do I customize the order of the tracks so I can burn a CD the way I want to?

    You have to make aplaylist in order to burn to a CD. Once you have the burn playlist, you can either sort by the columns, of if you have the little black triangle in the header row at the extreme left, you can drag tracks into any order you like.

  • Tilda and sort order in iTunes

    I used to put a tilda (~) in front of an album title to get it to move to the top of the alphabetized album list in iTunes browser view. Unfortunately, with the recent upgrade to v 7.3, the program no longer recognizes the tilda (it just ignores it and alphabetizes based upon the following text). Any recommendations as to how to get iTunes to recognize the tilda like it used to, or failing that, what character may I put at the start of an album name to jump it to the top of the alphabetized list?
    Thank you!

    I get the same thing too.. so what bright spark at Apple didn't consider the impact on users by making this totally unnecessary change?
    I have nearly all my playlists (lots) with tildas (~) or hashes (#) at the front of track names to get them to move to the top in an order that works for me personally.. now all my playlists tracks are all over the place which isn't helpful as I use iTunes as a 'jukebox' for stage shows for playback.. this caused a slight chaos on the first night after upgrading as I wasn't aware that this change had been made and now I have a lot of extra work to overcome this problem.. so I guess there may be quite a lot of unhappy/angry people about this change !!
    Come on Apple.. put the tilda back to where it should be please and think of the impacts before making such unnecessary changes!!
    Thx !
    Powerbook 15" 1.5Ghz   Mac OS X (10.4.10)  

Maybe you are looking for

  • Short dump error when using count(*)

    Hi Experts I am getting a short dump error when selecting the records >= current date - 30 see the coding and comment please correct the coding I want to know the ztable records it is important for command interface. I have 1402345 records available

  • I can't save and open .ai files.

    Hello. I can't save and open the file with special character in virtual drive(using communications). -> refer to this.. ( http://software.naver.com/software/summary.nhn?softwareId=MFS_105031 ) *Special character I used is 黒(not 黑). If I rename the fi

  • Colorspan help needed

    Hello. I have a Colorspan 72SR that I of course bought used. It won't boot up and gives an error of "no internak disk detected". I had to replace the power supply before I could get anything out of it and don't know if I damaged the onboard DOM card

  • How to create an object of a binary file?

    Does anyone know how I may create a serializable object of a binary file? Thanks.

  • Spacing in drop down menu

    I have made a drop down navigation menu in dreamweaver cs6 but I would like to shrink some of the spacing between the menu opinions. The places marked in red is what I would like to shrink so there is less space between the text and next navigation b