PhaseListener: before or after which phase should I set the locale?

Hello,
I use restfaces an I have UrLs such as mydomain.com/fr/book/etc
where /fr/ is the desired locale. I have tried retrieving the locale string from the URL and setting the locale from a PhaseListener before the renderResponse phase but it does not work i.e. when I change the locale in the address bar to /en/book/etc it will not change the locale. Any clue?
Thanks in advance,
JUlien.
Here is the phase listener:
public class DebugPhaseListener implements PhaseListener {
private static transient Logger log = Logger.getLogger("com.jeanbaptistemartin.util");
public DebugPhaseListener() {
log.debug("DebugPhaseListener constructor");
public void afterPhase(PhaseEvent phaseEvent) {
log.debug("after---> " + phaseEvent.getPhaseId());
public void beforePhase(PhaseEvent phaseEvent) {
Locale locale = extractLocale(FacesContext.getCurrentInstance().getExternalContext().getRequestServletPath());
FacesContext.getCurrentInstance().getViewRoot().setLocale(locale);
public PhaseId getPhaseId() {
return PhaseId.RENDER_RESPONSE;
private Locale extractLocale(String servletPath) {
String[] array = servletPath.split("/");
return new Locale(array[0]);
}Here is the managed bean (I actually use spring):
@Component("sculptureView")
@Scope("request")
public class SculptureView {
private Logger log = Logger.getLogger("com.jeanbaptistemartin.view");
private JbmService service;
private Sculpture sculpture;
public SculptureView() {
log.info("Sculpture()");
@Autowired
public SculptureView(JbmService service) {
log.info("Sculpture(JbmService service)");
this.service = service;
@Instance("#{sculptureView}")
@HttpAction(value = "sculptureAction", pattern = "{locale}/sculpture/{id}")
public String getBookById(@Param("id") int id, @Param("locale")String locale) {
this.sculpture = service.findByID(id);
log.debug("Locale: "+  locale);
return "/sculpture.jsp";
public Sculpture getSculpture() {
return sculpture;
public void setSculpture(Sculpture sculpture) {
this.sculpture = sculpture;
}The problem I get is that the jsp page still display today's date in french...
Julien.
I meant "sculpture" instead of "book"
Edited by: balteo on Jul 10, 2008 5:51 AM

Thanks a lot! You spotted a big mistake on my part.
Otherwise, my lifecycle listener works when I use the RESTORE_VIEW phase (afterPhase method).
Do you think it is the appropriate phase? Should I use another one?
Julien.

Similar Messages

  • Ive just upgraded my iphone 4 to 5, should i sync my phone before or after my number has changed to the iphone 5?

    ive just upgraded my iphone 4 to 5, should i sync my phone before or after my number has changed to the iphone 5?

    When you restore from an itunes backup it doesnt backup music or ring tones. resync from the computer that has the music. If you bought all the songs from iTunes, you can always redownload them but ringtones are a one-time download. Follow the article to redownload them. For the ringtones you can contact Apple to ask for a redownload of them
    http://support.apple.com/kb/ht2519

  • Which situation should we use the text item with the item category TATX

    Dear experts!
    Thank you for your attention!
    I am confused with text item (TATX).
    which situation should we use the text item with the item category TATX????
    Someone told me that the text item is dummy and should be used as a manual of certain standard item. But the manual may be a book or several papers and it also takes up some inventory not a dummy.
    So, could some body tell me what the text item (TATX) exact is and what function it has.
    Best regard!
    Tangdark

    Hi,
    you can use TATX if you like to enter a text and to print some information between the item lines.
    Regards
    William

  • Using a PhaseListener in order to set the locale on the UIViewRoot

    Hello,
    I am wondering which is the best phase to set the locale on the UIViewRoot...
    I don't know whether to choose the "update model values" or the "invoke application" phase and whether to set it before or after the phase.
    Can anyone please help?
    Thanks in advance,
    J.

    I'd say at any time AFTER the restore view and BEFORE the render response phase should be fine. I cannot be 100% sure as I've never actually done this. I would experiment and find out if I were you, only way to be really sure.
    I'm assuming you want to do this to only have to put this code in one place. Its not an option to use f:loadBundle in a facelets template that you share among all your pages? Then you don't have to muck about with phase listeners.

  • SCCM issue - "LANG_LIST has some locales which does not match with the locale of serial number"

    I have a problem with the error "LANG_LIST has some locales which does not match with the locale of serial number" recurring.
    I am trying to install Acrobat XI Std silently by SCCM.
    I've used the Adobe Customisation Wizard to create a mst which include the volume serial number we have with our licence purchases. Note that I am in Australia. I use the command line in SCCM for the install as "msiexec /i "AcroStan.msi" TRANSFORMS="D&B_AcroStd.mst" /qn" which fails silently. If I install on a local machine using an admin command prompt and changing to /qb at the end, I get the aforementioned error.
    I have a few things to try and resolve, having searched the adobe forums and other forums for the solution. The mst is only trying to install US English & I have even gone so far as to use the direct editor in the customisation wizard and change some values in the property table to resolve this. In the property table I can confirm that LANG_SEL_DEFAULT = ENU, REGIONAL_LIST = ENU, LANG_LIST = en_US, ProductLanguage = 1033
    Is there a way to check the language specified for ym serial number?
    Bryndon

    Update on a couple of details:
    @Sabian,
    Thanks for the location, I've downloaded and then when I tried an install of the newly extracted msi (admittedly on the same computer) I got exactly the same issue. Of note though is that running /qf automatically brought up the same serial number and the same incorrectly spelled company name. Installing on another computer (freshly imaged) doesn't have those inputs already present under /qf. Next when I try using the transfrom (a new one) with /qr it gives an error of the serial number, displaying the entire serial.
    @Sebastian
    I've had a look through yours and it seems our issues could have the same origin. Looks like I may have to call customer support regarding the serial number as Sabian suggested in your thread.
    The bit that gets me is when the same serial number is used in a manual install (or /qf) then it installs ok without any errors.

  • How should I set the iMac display in normal mode

    how should I set the iMac display in normal mode

    Not certain if this is what you're asking, but the normal setup would be System Preferences>Displays>Disply tab and select 'Best for display'.

  • Setup.exe gives a "LANG_LIST has some locales which does not match with the locale of serial number"

    I ran the Adobe Customization Wizard XI to create a transform file and now when run setup.exe it always come with the error "LANG_LIST has some locales which does not match with the locale of serial number".
    It does the same thing when using msi with the command : msiexec /i  AcroPro.msi TRANSFORMS=AcroPro.mst /qb!
    Here is my setup.ini file
    [Startup]
    RequireOS=Windows XP
    RequireMSI=3.1
    RequireIE=7.0.0000.0
    Require64BitVC10RT=1
    CmdLine=/spb /rs /sl"1036"
    [Product]
    msi=AcroPro.msi
    vcrtMsi=vc_red.msi
    vcrtDir=VC10RT_x64
    Languages=1033;1036
    2052=Chinese Simplified
    1028=Chinese Traditional
    1029=Czech
    1030=Danish
    1043=Dutch (Netherlands)
    1033=English (United States)
    1035=Finnish
    1036=French (France)
    1031=German (Germany)
    1038=Hungarian
    1040=Italian (Italy)
    1041=Japanese
    1042=Korean
    1044=Norwegian (Bokmal)
    1045=Polish
    1046=Portuguese (Brazil)
    1049=Russian
    1051=Slovak
    1060=Slovenian
    1034=Spanish (Traditional Sort)
    1053=Swedish
    1055=Turkish
    1058=Ukrainian
    1025=English with Arabic support
    1037=English with Hebrew support
    6156=French (Morocco)
    CmdLine=TRANSFORMS="AcroPro.mst"
    [Windows XP]
    PlatformID=2
    MajorVersion=5
    MinorVersion=1
    ServicePackMajor=3
    [MSI Updater]
    Path=WindowsInstaller-KB893803-v2-x86.exe
    I don't know what goes wrong as took my serial number on my profile from the adobe web site, same thing for the download of the software.
    Does it means that the serial number provided was invalid for deploying ?
    NB.: My goal is to deploy our Acrobat XI through SCCM in silent mode and I don't know if there is extra consideration for that.  For now it's only not working at the command line.
    Another important point is that the install works great without customization !  If I just run the setup.exe from freshly extracted files and I use my serial number, everything is working fine.
    So what goes wrong ?

    Thanks for the reply brogers_1 and Vinod Dbhal, you gave good hint.
    I retried installing the initial package in French on a Windows 7 English and the software installed properly in French. 
    As I used to work with virtuals for those tests, I rolled back my virtual and redo my test installation with chosing to install it in English on my Windows 7 English and again the installation finished properly but I was surprised when I realized that even if I chose English as language, the software was running in French !
    Of course I can change the language settings (in the edit-preferences-language) to follow the operating system witch is nice.
    That gave me the cue I needed to know.  I started from scratch my customization with choosing only the French language in the "Application Languages" and I left the MUI Languages blank and saved the .mst
    I ran again the same command : msiexec /i  AcroPro.msi TRANSFORMS=AcroPro.mst /qb!
    And everything works fine.
    NB.: As I used the .msi directly, of course I had to install the prerequirement Visual C++ 2010 first.  Otherwise the installation failed without any error message.
    Thanks again to you for your good hint,
    Bob

  • Where Should I Set the Layer Break Marker?

    I am burning to a Memorex DVD+R DL media------
    I received this error message when burning:
    "Formatting was not successful. Layer 0 exceeds the
    maximum layer size allowed. Please choose a suitable
    marker location that will support this condition."
    I placed one approx halfway through my main sequence, which
    is a total of 4.6 GB, but I am still receiving this message.
    Where should I place the marker so I can successfully output?
    My total project is about 6.2 GB.

    So you are telling me that I could delete the DNS from each machine and set it in either the new modem or Time Capsule router.
    That is correct!
    I guess what I'm confused at is what device is doing what.
    Let's look at a few examples, hopefully to help understand where all these protocols/services (PPPoE, DNS, & DHCP) come into play:
    Scenario 1: Modem > Computer
    In this scenario, your ISP provides the DNS server IP address information to your computer via DHCP. DHCP also provides the other important IP address information: IPv4 address, subnet mask, & router IP to your computer in order to communicate on the Internet.
    Since your DSL ISP requires that you are authorized to access their Internet service, they utilize PPPoE to pass your account credentials (username & password) from your computer to their authorization server. Once verified, you are granted access.
    Scenario 2: Modem > Router (Actiontec) > Computer
    In this scenario, your Actiontec router provides your account credential (via PPPoE) to the ISP and also acts as a DHCP server. As a DHCP server, it provides your computer with the required IP addresses and passes on the ISP's DNS IP addresses as well. You do have an option with this router to enter a different set of DNS IP addresses ... like those for Google DNS or OpenDNS if you do NOT want to use the ISP's DNS servers. In this case, the Actiontec, uses its DHCP server to provide those addresses to your computer.
    Scenario 3: Modem > Upstream Router (Actiontec) > Downstream Router (TC) > Computer
    Since you have the TC configured as a bridge, it is basically a "pass-through" device. That is, the Actiontec will continue to provide the IP addresses just like in Scenario 2 "through" the TC so that wired or wireless clients connected to the TC get the addresses. Also, like in Scenario 2, you can assign DNS IP addresses on the TC ... and these would be provided to clients connected to it.

  • How should i set the baseURI when a db file path with a space

    if the db file in a path like c:\program file\myapplication,then i set the baseURI dbxml:c:\program file\myapplication ,some exception occur~what should i do ?
    thanks a lot

    The Base URI needs to be a valid URI, which means it cannot include the Windows '\' character at all. In your case, you should be fine using something along the lines of "file:////C:/program file/myapplication"
    (give or take a '/' or two -- I haven't tested this).
    It's a common for BDB XML users to confuse the argument to create/openContainer() (a filesystem path) with the Base URI (a URI). The meanings and requirements are different. The best thing to do is to set and use a container alias (XmlContainer::addAlias()) to use in your queries.
    Regards,
    George

  • How should I set the parameters of PID Autotuning such as relay amplitude and PV noise level?

    I want to control the temperature of a room by changing the hot water flow of a radiator with a control valve. The desirable control accuracy is +/- 0.5 degree of centigrade.
    What number should I set for relay amplitude? And what number should I set for PV noise level?

    Hello loghmani,
    If your output is saturating try to reduce your relay amplitude and/or reduce the gain Kc of the PID controller before starting the autotuning procedure.  You can find more information about each of the parameters that you've inquired about at this KnowledgeBase article.
    I would recommend taking a look at the General Auto PID Simulator.vi example.  You can find this example by doing a search in the example finder or by clicking linked example at the bottom of the detailed help page of the Autotuning PID.vi.
    If you haven't looked at the PID user manual that also contains useful information on setting up PID algorithims and Autotuning.
    David A
    National Instruments
    FlexRIO Product Support Engineer

  • On which device do you set the password?

    I have a AP Express g connected to a Extreme n. Because I am using the AP Express g, I understand I need to use WEP security. My question is when using Airport Utility, do I set the password on the Extreme n using "WEP (Transitional Security Network)" or do I first set a password on the Express g then match that password on the Extreme.
    Thank you in advance.
    Robert

    Robert,
    You don't need to have the same password for each device. You can have a different password for all your devices if you choose, however, it is easier to have the same password for most of us.
    It doesn't matter which one you first set a password for.
       Joseph Kriz

  • When installing Firefox 35 into Windows 7 running inside VMware Fusion on a Mac, into which folder should I put the downloaded Firefox installer file?

    Inside Windows I see a folder called PROGRAM FILES and another one called PROGRAM FILES (X86). Is either of these the correct one to put the Firefox installer program into before I launch the installer? There is also a folder called WINDOWS. Sorry for such an elementary question but I've never been a Windows user; just Macs so far until now. My intention is to download the Windows version of Firefox using a browser on the Mac side of the computer since I have working browsers there. Then I would copy the ".exe" file to whichever Windows folder is correct. Am I on the right track or am I courting disaster?
    Also, will there be a preference inside Firefox to make it the default browser in the Windows environment? I'd like to avoid using Internet Explorer.
    ( I'm writing this from the Firefox browser, v. 28.0 in the Mac OS (10.6.8). I didn't click the "Automatically Add" button for submitting troubleshooting information because I'm not asking about the browser in the Mac OS environment.)
    Thank you.

    The full Windows install file from for instance https://www.mozilla.org/firefox/all/ is an executable dot.exe file.
    It will run from anywhere the user has the correct permissions, incluing the desktop or the downloads folder. It will offer standard or custom installs, usually opt for the standard install and the necessary flies and folders will be created.
    * [[How to download and install Firefox on Windows]]
    Setting Firefox as the default browser may be done from an option as Firefox starts after installation
    * [[Make Firefox your default browser]] -> (the KB page does have selectors)
    ** https://support.mozilla.org/kb/make-firefox-your-default-browser#firefox:win7:fx35

  • Which format should I have the camera men send me for editing in HD?

    Hello All,
    Thank you in advance for all help. I have a Mac G4 with dual processor, 2gb mem, FCEHD 3.0, 500GB external hard disk and Canon GL2.
    I have been editing fine with this setup for quite some time and am very pleased. I now have a client that will be sending me concert tour footage (3 cameras) from each city. My question is, what will I need to get this done? I would like several recommendations from different editors if possible?
    If it will be too costly to do this, what are your recommendations? Thank you again, MilliMac

    millimac -
    With FCE 3.0 the only formats for direct capture in FCE are either DV or HDV. Your GL2 is only a DV format camera, so if you are going to use your GL2 to capture tapes that your client sends you, they should shoot in DV, not HDV. Further, make sure your client shoots in 480i60 (NTSC interlaced) not 480p30 (progressive). Depending on their camera they may or may not have an option to select progressive mode, but you should make sure to tell them that you need NTSC DV, interlaced. That should be enough information for them.
    The GL2 can also shoot/play anamorphic so you could get 16:9 video if your client can shoot DV Anamorphic. (Keep in mind that is simply 16:9 aspect ratio, it is not HD or HDV video). However this can be a tricky area unless the same camera model is used for both the shoot and the FCE capture.
    If for some reason they intend to send you HDV material you will either need an HDV camera yourself in order to capture the tapes in FCE, or some alternate means to import the video to your Mac plus convert it to Apple Intermediate Codec before importing it into FCE (vs capturing it in FCE). MPEG Streamclip is a great utility for doing the conversion but it adds extra steps between the tape and being able to edit the video in FCE.
    I hope this was helpful.

  • I am looking to buy an iPad. Which iPad should I buy the 2nd gen or the 3rd gen?

    Please help me regarding it. As I have heard that 3rd gen has overheating problems. That is why I am asking this question

    What are all the differences between the iPad 3rd Gen and the iPad 2? Is the iPad 2 worth the cost savings?
    http://everymac.com/systems/apple/ipad/ipad-faq/differences-between-ipad-3rd-gen -2012-ipad-2-2011.html
    What are all the differences between the iPad 3rd Gen models? Which should I buy?
    http://everymac.com/systems/apple/ipad/ipad-faq/differences-between-ipad-3rd-gen -early-2012-models.html
    Should I Buy a New iPad? Or an iPad 2?
    http://www.maclife.com/article/blogs/should_i_buy_new_ipad_or_ipad_2
     Cheers, Tom

  • So I have a (PC) laptop with 8gb of RAM and I'm running CC on it. I haven't set it up on this before so I'm wondering how much should I set the RAM usage to in performance so I can use it but not ruin this laptop?

    I just don't know where specifically to put the RAM at in the preferences option.
    I mainly use it for digital painting and sketching on this. (not so much painting on this but digital art)

    8 GB is about the realistic minimum for Photoshop nowadays.
    Set it to about 70% and go for there.  Note that it represents a maximum percentage of your momentarily available RAM after the OS and other running application have grabbed what they need., not a percentage of total installed RAM.  It changes continually.
    The rule of thumb I follow to figure out scratch space says to figure on 50 to 100 times the size of your largest file ever multiplied by the number of files you have open.  I have seen the scratch file exceed 800 GB once, an admittedly rare occurrence, but it often exceeds 200 GB when stitching large panoramas and the like.
    As an example—and stressing that I'm aware that others have even more scratch space than I do—I keep two dedicated, physically separate hard drives as my primary and secondary Photoshop scratch disks and a lot of GB free on my boot drive for the OS.  I also have 16 GB of RAM installed.
    Additionally, if you only have a single HD, i.e. your boot drive, you'd need it to be large enough to accommodate both the swap files of the OS as well as Photoshop's scratch.

Maybe you are looking for