JSF Internationalizing

Good day!
It's seems where is a problem with internationalizing JSF application.
Existing implementation of JSF 1.2 doesn't give a chance to use
resources in XML format. Java SE 6 allows developers to use custom
ResourceBundles. Does anybody know how to use custom ResourceBundles in JSF 1.2 framework?

Hi!
here is brief steps to implement resource bundle:
1. create property resource files. for example:
com.custom.Resource.properties
com.custom.Resource_en.properties
com.custom.Resource_de.properties
then fill out them with some values:
key = value
2. In faces-config.xml declare:
<application>
<locale-config>
<default-locale>de</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>de</supported-locale>
</locale-config>
</application>
3. In ur jsf file:
<f:loadBundle basename="com.custom.Resource" var="bundle" />
<h:outputText value="#{bundle.key_name}"/>
looks like it works...

Similar Messages

  • Why isn't my jsf app internationalizing?

    Hello all -
    Using NB 6.5.1, JDK 6, Java EE 5, and Glassfish V3, so nothing but the good stuff. This should be simple for anyone who is already internationalizing their apps, so please assist.
    New to i18n but badly needing to grasp it, I have developed the following mini project that should change its displayed language but only based on user choice, and not the browser's settings.
    1) created a jsf web app project (called langs) with Visual Web Java Serverfaces support
    2) dragged & dropped (d&d) a dropdown list object and configured it with two items: en and fr for English and French. Also, made it "Auto-submit on change" and provided it this event handler:
       public void dropDown1_processValueChange(ValueChangeEvent event) {
          FacesContext context = FacesContext.getCurrentInstance();
          UIViewRoot viewRoot = context.getViewRoot();
          String loc = dropDown1.getSelected().toString();
          viewRoot.setLocale(new Locale(loc));
          info("Locale: " + viewRoot.getLocale().toString());
       }3) d&d a loadBundle object into the jsf page, so the jsp version of the page now has this tag:
    <f:loadBundle basename="langs.Bundle" var="msg1"/>4) added one locale, this is the "fr_FR - French / France" as shown in the "New Locale" dialog
    5) into the Bundle.properties file, I added one key: "welcome", with default language: "hello", and fr_FR - French language: "au revoir"
    6) d&d a label object onto the page, and set its text as follows: #{msg1.welcome}. As soon as I do that, the text is shown rendered on the development page to "hello", so I am accessing the file OK.
    7) ... and that's it. I run the program, all I ever see is the word "hello". I change the selection from the drop down list of course and the page refreshes, but all I see is "hello". I check print out the value of the viewRoot's locale and it shown me either "en" or "fr" in accordance with my selection, but the displayed string is "hello".
    I have been stuck with this for (well, I am shy to say) sometime now and I really need to solve it. What am I "not" doing? I must be missing something that makes the app oblivious to the file named Bundle_fr_FR.properties (the other one of course is Bundle.properties).
    And while we are it, can I pick and choose my bundle files dynamically from within the application to force the app to get the values for the keys from a certain file? For example, suppose I want to internationalize and app into 7 languages (some LTR, others RTL) and I don't want to put all the values for the keys in one "basename" file, could I do that?
    Your answer and pointers are much, much appreciated. Thank you.
    Mohsen

    Why not get sun's J2EE tutorial and follow the steps explained there.
    Even if you insist on using Netbeans' drag and drop facilities, you could still view the source to make sure that it matches what's explained in the tutorial. I find that doing some things manually first helps me understand and appreciate the processes better when I later use a tool to speed up development.

  • Problem in JSF with Swing in a web application

    hi
    i am using jsf for my online projects.my problem is that when i use Swing concept ,the server is closed automatically when i click the swing dialog option 'OK', how can i protect server being closed automatically when user click the the options of Swing dialog box.it is so tedious because my application is going to integrate
    with online server?
    my swing java file is
    * FileExistsDialog.java
    package com.obs.ftw.util.alert;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.Rectangle2D;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.plaf.metal.MetalLookAndFeel;
    * FileExistsDialog: A JOptionPane-like dialog that displays the message
    * that a file exists.
    public class FileExistsDialog extends JDialog {
    * The component that gets the focus when the window is first opened
    private Component initialFocusOwner = null;
    * Command string for replace action (e.g., a button).
    * This string is never presented to the user and should
    * not be internationalized.
    private String CMD_REPLACE = "OK"/*NOI18N*/;
    * Command string for a cancel action (e.g., a button).
    * This string is never presented to the user and should
    * not be internationalized.
    private String CMD_CANCEL = "CANCEL"/*NOI18N*/;
    // Components we need to access after initialization
    private JButton replaceButton = null;
    private JButton cancelButton = null;
    public FileExistsDialog(){
         System.out.println("INSIDE THE FILE EXIST DIALOG");
         JFrame frame = new JFrame() {
         public Dimension getPreferredSize() {
         return new Dimension(200,100);
         frame.setTitle("Debugging frame");
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.pack();
         frame.setVisible(false);
    FileExistsDialog dialog = new FileExistsDialog(frame, true);
         dialog.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent event) {
         System.exit(0);
         public void windowClosed(WindowEvent event) {
         System.exit(0);
         dialog.pack();
         dialog.setVisible(true);
    * Creates a new FileExistsDialog
    * @param parent parent frame
    * @param modal modal flag
    public FileExistsDialog(Frame parent,boolean modal) {
    super(parent, modal);
         //initResources();
         System.out.println("INSIDE THE FILE EXIST DIALOG CONSTRUCTOR");
    initComponents();
    pack();
    * Determines the locale, loads resources
    /* public void initResources() {
         Locale locale = Locale.getDefault();
    resources = ResourceBundle.getBundle(
              "samples.resources.bundles.FileExistsDialogResources", locale);
    imagePath = resources.getString("images.path");
    }*/ // initResources()
    * Sets all of the buttons to be the same size. This is done
    * dynamically after the buttons are created, so that the layout
    * automatically adjusts to the locale-specific strings.
    private void equalizeButtonSizes() {
         System.out.println("INSIDE THE equalizeButtonSizes()");
    String[] labels = new String[] {
    replaceButton.getText(),
         cancelButton.getText()
         // Get the largest width and height
         Dimension maxSize= new Dimension(0,0);
         Rectangle2D textBounds = null;
         Dimension textSize = null;
    FontMetrics metrics =
              replaceButton.getFontMetrics(replaceButton.getFont());
         Graphics g = getGraphics();
         for (int i = 0; i < labels.length; ++i) {
         textBounds = metrics.getStringBounds(labels, g);
         maxSize.width =
         Math.max(maxSize.width, (int)textBounds.getWidth());
         maxSize.height =
         Math.max(maxSize.height, (int)textBounds.getHeight());
    Insets insets =
         replaceButton.getBorder().getBorderInsets(replaceButton);
    maxSize.width += insets.left + insets.right;
    maxSize.height += insets.top + insets.bottom;
    // reset preferred and maximum size since BoxLayout takes both
         // into account
    replaceButton.setPreferredSize((Dimension)maxSize.clone());
    cancelButton.setPreferredSize((Dimension)maxSize.clone());
    replaceButton.setMaximumSize((Dimension)maxSize.clone());
    cancelButton.setMaximumSize((Dimension)maxSize.clone());
    } // equalizeButtonSizes()
    * This method is called from within the constructor to
    * initialize the dialog.
    private void initComponents() {
         System.out.println("INSIDE THE initComponents()");
         // Configure the window, itself
    Container contents = getContentPane();
    contents.setLayout(new GridBagLayout ());
    GridBagConstraints constraints = null;
    setTitle("Waring");
         // accessibility - all applets, frames, and dialogs should
         // have descriptions
         this.getAccessibleContext().setAccessibleDescription("Descriptions");
         addWindowListener(new WindowAdapter() {
         public void windowOpened(WindowEvent event) {
              // For some reason the window opens with no focus owner,
              // so we need to force the issue
         if (initialFocusOwner != null) {
              initialFocusOwner.requestFocus();
              // Only do this the 1st time the window is opened
              initialFocusOwner = null;
         public void windowClosing(WindowEvent event) {
         System.out.println("INSIDE THE windowClosing");     
         // Treat it like a cancel
              windowAction(CMD_CANCEL);
         // image
    JLabel imageLabel = new JLabel();
    imageLabel.setIcon(
    new ImageIcon("/images/degraded_large.gif"));
    // accessibility - set name so that low vision users get a description
    imageLabel.getAccessibleContext().setAccessibleName("OK");
    constraints = new GridBagConstraints ();
    constraints.gridheight = 2;
    constraints.insets = new Insets(12, 33, 0, 0);
    constraints.anchor = GridBagConstraints.NORTHEAST;
    contents.add(imageLabel, constraints);
    // header
    JLabel headerLabel = new JLabel ();
    headerLabel.setText("SAMPLE");
    headerLabel.setForeground(
         new Color(MetalLookAndFeel.getBlack().getRGB()));
    constraints = new GridBagConstraints ();
    constraints.insets = new Insets(12, 12, 0, 11);
    constraints.anchor = GridBagConstraints.WEST;
    contents.add(headerLabel, constraints);
         // Actual text of the message
         JTextArea contentTextArea = new JTextArea();
    contentTextArea.setEditable(false);
    contentTextArea.setText("SAMPLE");
    contentTextArea.setBackground(
              new Color(MetalLookAndFeel.getControl().getRGB()));
    // accessibility -- every component that can have the
         // keyboard focus must have a name. This text area has no
         // label, so the name must be set explicitly (if it had a
         // label, the name would be pulled from the label).
    contentTextArea.getAccessibleContext().setAccessibleName(
              "CONTENTNAME");
    constraints = new GridBagConstraints ();
    constraints.gridx = 1;
    constraints.gridy = 1;
    constraints.insets = new Insets(0, 12, 0, 11);
    constraints.anchor = GridBagConstraints.WEST;
    contents.add(contentTextArea, constraints);
         // Buttons
         JPanel buttonPanel = new JPanel();
    buttonPanel.setLayout (new BoxLayout(buttonPanel, 0));
         replaceButton = new JButton();
         replaceButton.setActionCommand(CMD_REPLACE);
    replaceButton.setText("OK");
    replaceButton.setToolTipText("TO OK");
         replaceButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
         windowAction(event);
    buttonPanel.add(replaceButton);
    // spacing
    buttonPanel.add(Box.createRigidArea(new Dimension(5,0)));
         cancelButton = new JButton();
         cancelButton.setActionCommand(CMD_CANCEL);
    cancelButton.setText("CANCEL");
    cancelButton.setNextFocusableComponent(replaceButton);
         cancelButton.setToolTipText("TO CANCEL");
         cancelButton.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent event) {
         windowAction(event);
    buttonPanel.add(cancelButton);
    constraints = new GridBagConstraints ();
    constraints.gridx = 1;
    constraints.gridy = 2;
    constraints.insets = new Insets(12, 12, 11, 11);
    constraints.anchor = GridBagConstraints.WEST;
    contents.add(buttonPanel, constraints);
         // Equalize the sizes of all the buttons
         equalizeButtonSizes();
         // For some reason, the dialog appears with no input focus.
         // We added a window listener above to force the issue
         initialFocusOwner = replaceButton;
    } // initComponents()
    * The user has selected an option. Here we close and dispose the dialog.
    * If actionCommand is an ActionEvent, getCommandString() is called,
    * otherwise toString() is used to get the action command.
    * @param actionCommand may be null
    private void windowAction(Object actionCommand) {
         System.out.println("INSIDE THE WINDOW ACTION");
         String cmd = null;
    if (actionCommand != null) {
         if (actionCommand instanceof ActionEvent) {
         cmd = ((ActionEvent)actionCommand).getActionCommand();
         } else {
         cmd = actionCommand.toString();
         if (cmd == null) {
         // do nothing
         } else if (cmd.equals(CMD_REPLACE)) {
         System.out.println("your replace code here...");
         } else if (cmd.equals(CMD_CANCEL)) {
         System.out.println("your cancel code here...");
         setVisible(false);
         dispose();
    } // windowAction()
    * This main() is provided for debugging purposes, to display a
    * sample dialog.
    // main()
    } // class FileExistsDialog
    and calling java function is
    public String fileDialog(){
         return "Success";
    public void processFile(ActionEvent event){
         System.out.println("INSIDE THE FILE DIALOG");
         FileExistsDialog file     = new FileExistsDialog();
         System.out.println("SUCCESS");
    called from
         <h:commandButton action="#{userLogin.fileDialog}" actionListener="#{userLogin.processFile}"></h:commandButton>
    pls help me as soon
    advance thanks
    rgds
    oasisdeserts

    Swing is GUI library for use in desktop applications.
    JSF is a web application framework which runs on an application server and is accessed by clients via web browsers.
    To fully understand what you have done, try accessing your application from a different machine than the server.
    To answer your question, don't invoke System.exit() if you would like the process to continue. But that is the least of your problems.

  • JSF webapp works with Java 1.4, but not Java EE 5

    Hello
    I am having a really weird problem with internationalizing my JavaServer Faces web application.
    I am using Netbeans 6.0, Tomcat 6.0.10, JSF 1.2, and JTSL 1.1....
    If I use Java 1.4 to run the webapp, everything works fine!
    If I use Java EE 5 then it fails to execute internationalization of my choosen locale.
    I could just use Java 1.4 and have my site working fine, but I would really like to use Java EE 5 since it can do more. Also I don't see why it can work on one version of Java but not another. My locales are English (en) and Korean (ko).
    This is my index.jsp
    <%--
        Document   : index
        Created on : 2/05/2008, 01:33:01
        Author     : Steve
    --%>
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jstl/core"%>
    <html>
        <f:view locale="#{localeBean.language}">
            <f:loadBundle basename="resources.messages" var="msg"/>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
                <title>JSP Page</title>
            </head>
            <body>
                <h2>Hello <h:outputText value="#{localeBean.country}"/>!</h2>
                <br>
                <h4><h:outputText value="#{msg.language}"/>:</h4>
                <h:form id="languageForm">
                    <h:selectOneMenu   onchange="this.form.submit();" valueChangeListener="#{localeBean.dropdown1_processValueChange}">
                        <f:selectItem itemLabel="English" itemValue="en"/>
                        <f:selectItem itemLabel="������" itemValue="ko"/>
                    </h:selectOneMenu>
                </h:form>
                <h:outputText value="#{localeBean.language}"/>
            </body>
        </f:view>
    </html>This is my localeBean which is under the package "resources"
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package resources;
    * @author Steve
    import java.util.Locale;
    import javax.faces.event.ValueChangeEvent;
    public class localeBean {
        private String language = Locale.getDefault().getLanguage();
        private String country = Locale.getDefault().getCountry();
        public String getLanguage() {
            return language;
        public void setLanguage(String newValue) {
            language = newValue;
        public String getCountry() {
            return country;
        public void setCountry(String newValue) {
            country = newValue;
        public void dropdown1_processValueChange(ValueChangeEvent vce) {
            setLanguage((String) vce.getNewValue());
    }This is my faces-config file
    <?xml version='1.0' encoding='UTF-8'?>
    <!-- =========== FULL CONFIGURATION FILE ================================== -->
    <faces-config version="1.2"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
    <application> 
            <locale-config>  
                <default-locale>en</default-locale>  
                <supported-locale>en</supported-locale>
                <supported-locale>ko</supported-locale>
            </locale-config>
            <message-bundle> resources.messages </message-bundle>
        </application>
        <managed-bean>
            <managed-bean-name>localeBean</managed-bean-name>
            <managed-bean-class>resources.localeBean</managed-bean-class>
            <managed-bean-scope>session</managed-bean-scope>
        </managed-bean>
    </faces-config>and lastly I have my message bundle under the "resources" package which is named "messages".
    This has a key word "language" which is "Language" in the 'en' locale file and "����" in the 'ko' locale file.
    Once again when using Java 1.4 this project runs fine, however with Java EE 5 it does not.
    You may notice in my index.jsp that I have <h:outputText value="#{localeBean.language}"/>
    I use this to display the locale that has been chosen by my select box. Even when this shows a different language has been chosen the page does still not display in the correct language. According to <f:view locale="#{localeBean.language}"> then the locale of the page should be changed.
    I have looked over the web quite far for an answer to this problem. But everyone else seems to be using a similar method of loading up a message bundle and using it the same way I am. However my method does not work.
    Any suggestions or clues to what is going wrong would be really appreciated.
    Thanks in advance^^

    it seems that the
    <f:view locale="en">
    only work if a ressource bundle with the locale sufix '_en' is provided.
    Everything works now if I provide 3 ressouce files:
    global_en.properties
    global_de.properties
    global.properties
    global.properties and global_en.properties are identically!
    But if I delete the global_en.properties file always the global_de.properties file wins before the default properties.
    I did not expect such a behavior :-(

  • JSF encoding problem with Russian

    Hi,
    I am new to JSF, trying to build prototype i18n JSF app with MyFaces 1.1.5
    Mostly care about IE6/7, do not officially support other browsers.
    I do have resource bundles, it is localized and internationalized.
    So user is supposed to work in either English or Russian.
    It all works except a few issues:
    1) When user enters something in Russian in inputText field on the first page,
    trying to pass it to the next page via managed bean.
    But instead of showing it in Russian, it shows some garbled text in outputText or outputLabel: Îëåã
    FF3 & Chrome show it as: &#1054;&#1083;&#1077;&#1075; [&#xxxx, where xxxx us a 4 digits]
    It does pick up labels from correct bundle on the next page, so locale is changed correctly.
    Actually, when I switch locale on the same first page, getting the same problem (after it's refreshed).
    Seems to work OK with Spanish
    Is that incorrect Cyrillic encoding, JSF encoding or broken Unicode or locale?
    How can we fix that ?
    Less important issues:
    2) When we switch locale (correct values in bundles), on the screen it can not change currencyCode, currencySymbol, TimeZone,
    it always shows the first one it picked, although dateTime and Number formatting changes correctly;
    3) In IE6 "alt" tag attribute produces garbled characters in Russian (black vertical squares), looks like IE6 bug; FF3 & Chrome work fine.
    Please help !
    TIA,
    Oleg.

    For 1, you are not passing the characters in the correct encoding from one page to the next when you pass the parameter (most likely).

  • CSS layout and Internationalization of JSF apps

    We use message bundles to handle internationalization in our JSF applications. This approach seems to work as we used HTML tables (or rather <h:panelGrid> tags) to layout components on the page.
    We had numerous customer complaints about tons of extra white space left on the screen in languages like German (where some words are very long). There are other issues with grid layouts, and we decided to give CSS positioning a try.
    I wonder, what folks on this forum think about using CSSP in conjunciton with JSF components. Also, given that text strings have different length in different languages, what is the i18n approach? Afterall, coordinates that work in English may not be accurate in German.
    Any suggestions, ideas, pointers would be greatly appreciated.
    Thanks,
    Vadim.

    Hi guys.
    The problem seems a little bit weird. But you could try the following. It is just the idea.
    1. You should recover the .properties file and get the Map for the current Locale. This should have to be done maybe in the Backing bean.
    2. Get the maximum length of the UIOutputText elements present in the form that you need to control its length. Now the important thing here is that you should have the value atribute of the UIOutputText objects based on an internationalized Base Bundle prefix. Just cut -based on the substring of the value attribute- the name of the property.
    3. Consider that you have to look in the Map the entry you just obtained from the UIOutputText object. After get the value of that Map entry (a String object) and get its length. At the end of the loop you sould have get the maximum length in characters of the component values to be displayed.
    4. Fix that value as an attribute in the backing bean.
    5. Use the output of that value to generate the style in CSS, as an String attribute of the Backing Bean. Base your CSS construction in "em" measures
    6. Change the -style- attribute in each component to reflect the correct length using CSS like this -style="#�{backingBeanName.style}"-. With this you will get an space dependent of the length of the localized values.
    Again. It is just a suggestion, I had not tried it already but I guess that will be my way in that case.
    Greets from Ecuador

  • What is the best practice for internationalizing (i18n) a DropDown list?

    I'm using Netbeans 6.1 and the Visual Web Editor to build out a website (It's very convenient). For most objects, I can internationalize them by binding to a resource bundle (e.g. for a label, or for the value of a textfield), but when it comes to drop-down lists, I am at a lost to figure out how.
    The problem stems from the fact that in the JSP code, the webuijsf tag expects the list of items to be derived from a backing bean object, not from selectItems between the dropDown element tags. For example:
    In my JSP:
    <webuijsf:dropDown id="dropDown1" items="#{Test.dropDown1DefaultOptions.options}"
       selected="#{Test.dropDown1DefaultOptions.selectedValue}"/>In my backing bean:
    import com.sun.webui.jsf.model.Option;
    // class globals
    SingleSelectOptionsList dropDown1DefaultOptions = new SingleSelectOptionsList();
    // inside init():
    dropDown1DefaultOptions.setOptions(new Option[]{
       new Option("male", "Man"),
       new Option("female", "Woman")
    dropDown1DefaultOptions.setSelectedValue("male");Now here's where I'm going with this...
    I have seen many examples of internationalizing a drop-down list by embedding tags between the dropdown element tags: for example
    <h:selectOneMenu id="dropDown1" items="#{Test.dropDown1DefaultOptions.options}"
       selected="#{Test.dropDown1DefaultOptions.selectedValue}">
        <f:selectItem itemValue="male" itemLabel="#{lang.value.gender.male}"/>
        <f:selectItem itemValue="female" itemLabel="#{lang.value.gender.female}"/>
    </h:selectOneMenu>Unfortunately, in every instance, whether I use webuijsf:dropDown tags, or h:selectOneMenu tags, or even f:selectOneListBox tags, none of them appear to accept the <f:selectItem> tags as arguments. Is it Netbeans, or am I doing something fundamentally wrong?
    Now...
    To internationalize the drop-down list, I've had to resort to using the resource bundle as a lookup during contsruction of the backing bean's Options, thusly:
    import com.sun.webui.jsf.model.Option;
    // class globals
    ResourceBundle bundle = ResourceBundle.getBundle("language.Language", locale);
    SingleSelectOptionsList dropDown1DefaultOptions = new SingleSelectOptionsList();
    // inside init():
    dropDown1DefaultOptions.setOptions(new Option[]{
        new Option("male", bundle.getString("value.gender.male")),
        new Option("female", bundle.getString("value.gender.female"))
    dropDown1DefaultOptions.setSelectedValue("male");The trouble with now is, every time the user changes locale, I must re-initialize the dropDown's default options list during the backing beans' prerender() method, as follows:
    public void prerender() {
        dropDown1DefaultOptions.setOptions(new Option[]{
            new Option("male", bundle.getString("value.gender.male")),
            new Option("female", bundle.getString("value.gender.female"))
    }Which works just fine, but as the pages get larger, the response time will undoubtedly go down the tubes. There must be a better pattern for this particular problem.
    Oh, and just for your notes, I have already tried the following:
    - declaring selectOptions inside the JSP's webuijsf tag
    <webuijsf:dropDown id="dropDown1" items="#{Test.dropDown1DefaultOptions.options}"
       selected="#{Test.dropDown1DefaultOptions.selectedValue}">
        <f:selectItem itemValue="male" itemLabel="#{lang.value.gender.male}"/>
        <f:selectItem itemValue="female" itemLabel="#{lang.value.gender.female}"/>
    </webuijsf:dropDown>- Using non-woodstock components, as such:
    <h:selectOneMenu id="dropDown1" items="#{Test.dropDown1DefaultOptions.options}"
       selected="#{Test.dropDown1DefaultOptions.selectedValue}">
        <f:selectItem itemValue="male" itemLabel="#{lang.value.gender.male}"/>
        <f:selectItem itemValue="female" itemLabel="#{lang.value.gender.female}"/>
    </h:selectOneMenu>Both of these throw exceptions that tell me I must use a <f:selectItems> tag which references the backing bean!!! Argh.
    Any suggestions? There must be a whack of people of there who've done this, and done it elegantly.
    Torin...
    Edited by: Torin_Walker on Oct 10, 2008 1:29 PM

    It really depends on what Bar is.
    If it's something simple then your Foo method
    is already testable, you just need to specify your expectations and invoke it statically, e.g.:
    Assert.IsTrue( FooContainer.Foo() );
    But if Bar encapsulates,
    say, your database access layer, then you can't test Foo without
    a real database, which is why (thanks @ysolik), static
    methods are death to testability. Or, in the words of Michael Feathers, "don't hide a TUF in a TUC"
    (TUF stands for a test-unfriendly feature, TUC stands for a test-unfriendly construct). If Bar is indeed
    test-unfriendly, then sorry, it doesn't work well without making Foo an
    instance method. You would need to redesign your code first:
    public class FooContainer {
    public bool Foo() {
    var bar = new Bar();
    When Foo is
    no longer static, you can invoke it on an instance of FooContainer:
    var container = new FooContainer();
    Assert.IsTrue( container.Foo() );
    The next step is to extract an interface from Bar (let's
    call it IBar)
    and inject it into FooContainer:
    public class FooContainer {
    private readonly IBar m_bar;
    public FooContainer( IBar bar ) { m_bar = bar; }
    public bool Foo() {
    // don't create another Bar, use m_bar
    Now you can mock/stub IBar with
    your favourite isolation
    framework and test your FooContainercode
    in isolation from its dependencies.

  • Problem: custom validator messages internationalized

    Hello everyone,
    I am trying to have a message that may be issued by a validator internationalized.
    Unfortunately I have no idea how to retrieve the appropriate bundleName (see comment in code below).
    It would be nice if someone could give me a hint how to solve the problem.
    Is there a nicer, more object orientated way of using Resource Bundles from Java?
    In the validator I am using the following code (taken in parts from Core JSF):
    public void passwordField_validate(FacesContext context, UIComponent component, Object value) {
    UIViewRoot viewRoot=context.getViewRoot();
    Locale locale=viewRoot.getLocale();
    ClassLoader loader=Thread.currentThread().getContextClassLoader();
    Application app=context.getApplication();
    String bundleName=app.getMessageBundle();
    if(bundleName==null) {
    // Since this is null I have a problem: How do I find the correct bundleName?
    ResourceBundle bundle=ResourceBundle.getBundle(bundleName,locale,loader);
    String incorrectPassword;
    try {
    incorrectPassword=bundle.getString("incorrectPassword");
    } catch (MissingResourceException mre) {
    // error handling
    // more code
    My faces-config.xml looks like this:
    <faces-config>
    <application>
    <locale-config>
    <default-locale>en</default-locale>
    <supported-locale>de</supported-locale>
    </locale-config>
    </application>
    </faces-config>
    and my Bundle.properties looks like this:
    incorrectPassword=Incorrect Password.
    similarly I have Bundle_de.properties, etc.

    I found a solution myself.
    The only drawback is that you need to fill in the name of the project.
    I used the code below:
    static public String getBundleString(FacesContext context, String key) {
    String text=null;
    try {
    ResourceBundle bundle =
    ResourceBundle.getBundle("<project_name>.Bundle",
    context.getViewRoot().getLocale());
    text=bundle.getString(key);
    } catch (Exception e) {
    text = "???" + key + "???";
    return text;
    }

  • Feature request for JSF i18n.

    First of all, bear with me for my english is poor.
    Utilizing JSF's i18n support, I created a small site that can display each of
    its pages in three different languages: English(en), Spanish(es) and Korean(ko).
    The page's view defaults to english but a user can view the pages in other languages, so the site can be viewed according to the user's preferred language. The user's language preference is stored in a session-scoped backing bean (preference.locale) so that the tag
    <f:view locale="#{preference.locale}">will show each page in the user's prefered locale.
    But the problem is this: If the user visited my site, selected the Korean
    locale and found some content interesting, he would probably copy the page's URL
    http://mysite/myapp/somedir/page1.jspand send it to a friend saying,
    "Hey buddy! go to this URL and read the article. Don't worry, you will surely
    understand the text because it's in Korean language."
    Then, his friend will reply saying,
    "Are you crazy? The URL you've given me is not in Korean, it's in English."
    Of course this will be the behavior of my site because the "preference" backing
    bean that determines the site's locale lives only in session scope; and, without
    this backing bean set to another langauge, all pages will initially be in English
    which is the default locale.
    But this problem could be fixed if the default locale of each page in my webapp relies not on a backig bean but on some pattern in the URL. For example, when the page
    http://mysite/myapp/somedir/page1.jspis accessed with this URL
    http://mysite/myapp/ko/somedir/page1.jspthe <f:view> of my application will default to Korean, indicated by the /ko/ pattern in the URL. It may also be http://mysite/myapp/en_US/somedir/page1.jsp
    that defaults to US English locale or http://mysite/myapp/es/somedir/page1.jsp
    that defaults to Spanish locale.
    I think if JSF has this feature, bookmarking problem on internationalized site could also be fixed and the contents of the website in different languages can also be indexed by search engines.
    I think, URL=accessibility.
    I don't want to use the querystring thing as the solution for this because of the reason that's hard for me to explain.
    If you get what I'm trying to express and this feature request sounds stupid, please educate my ignorance. If anyone has an idea of a better solution for this,
    please share. Thanks to all.

    You could use a Phase listener to check the current
    URL.
    I would rather use a URL with a request parameter, as
    follows:
    http://mysite/myapp/somedir/page1.jsp?locale=koIn your Phase listener, I would look for the locale
    parameter in the URL and set the local accordingly if
    it exists, otherwise, I would use the default one.
    Does that help?The pages in my site contains a lot of links and I dont want all those links to look like this:
    go to page 1
    or
    <h:outputLink value="page1.jsp">
    <f:param name="locale" value="#{preference.locale}"/>
    </h:outputLink>
    that's why I wanted all views in my pages to just rely on the preference.locale which is a session-scoped backing bean. But this approach has the problem I stated in my original post. I think it would be very nice for JSF if the <f:view> will be set by default according to some pattern in the URL (but not like query string).

  • How to get ALL values as default for  a drop down box in JSF

    Hi,
    I have a drop down box in JSF page which retrieves values from LOVCache.java. I have values like Company, Client, User, ALL in the drop down box.
    By default blank value is selected for the drop down box. I want to make ALL(which retrieves data for all the values) as default value for the drop down box.
    Could any body help me? Any help must be appreciated.
    Thanks,
    Aseet

    Thanks Nikhil. But I am fetching the values from the LOVCache.java.
    I am using <af:selectManyChoice>. Is there any way I can use LOVCache.java value for selecting default values instead of hard coding?
    I mean to say can I write
    unselectedLabel="#{LOVCache.entityTypeSelectionList.anyValue}"
    where LOVCache.entityTypeSelectionList is used to populate the drop down box.
    Regards,
    Aseet

  • I am trying to use java  file as Model layer and jsf as presentation layer

    I am trying to use java file as Model layer and jsf as presentation layer and need some help
    I successfully get the value of h:outputText from java file by doing simple binding operation but I am facing problems when I am trying to fill h:dataTable
    I create java file
    package oracle.model;
    import java.sql.;*
    import java.util.;*
    *public class TableBean {*
    Connection con ;
    Statement ps;
    ResultSet rs;
    private List perInfoAll = new ArrayList();
    *public List getperInfoAll() {*
    perInfoAll.add(0,new perInfo("name","username","blablabla"));
    return perInfoAll;
    *public class perInfo {*
    String uname;
    String firstName;
    String lastName;
    *public perInfo(String firstName,String lastName,String uname) {*
    this.uname = uname;
    this.firstName = firstName;
    this.lastName = lastName;
    *public String getUname() {*
    return uname;
    *public String getFirstName() {*
    return firstName;
    *public String getLastName() {*
    return lastName;
    right click on the file and choose 'create data control'
    then i wrote the jsf file:
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<f:view>*
    *<h:dataTable id="dt1" value="#{bindings.perInfoAll}"*
    var="item" bgcolor="#F1F1F1" border="10"
    cellpadding="5" cellspacing="3" rows="4" width="50%"
    dir="LTR" frame="hsides" rules="all"
    *>*
    *<f:facet name="header">*
    *<h:outputText value="This is 'dataTable' demo" id="ot6"/>*
    *</f:facet>*
    *<h:column id="c2">*
    *<f:facet name="header">*
    *<h:outputText value="First Name" id="ot1"/>*
    *</f:facet>*
    *<h:outputText style="" value="#{item.firstName}"*
    id="ot2"/>
    *</h:column>*
    *<h:column id="c4">*
    *<f:facet name="header">*
    *<h:outputText value="Last Name" id="ot9"/>*
    *</f:facet>*
    *<h:outputText value="#{item.lastName}" id="ot8"/>*
    *</h:column>*
    *<h:column id="c3">*
    *<f:facet name="header">*
    *<h:outputText value="Username" id="ot7"/>*
    *</f:facet>*
    *<h:outputText value="#{item.uname}" id="ot4"/>*
    *</h:column>*
    *<f:facet name="footer">*
    *<h:outputText value="The End" id="ot3"/>*
    *</f:facet>*
    *</h:dataTable>*
    *</center>*
    *</af:document>*
    *</f:view>*
    but nothing is appear in my table
    I know that there is something wrong in calling the binding object
    I need help pls and where can i find some help to deal with another tag types
    thanks

    i dragged the "perInfoAll" from my "Data Controls" and choosed adf table (even I know that new table with adf tags well be generated and i want table with jsf tags)
    and this code is generated
    *<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"*
    *"http://www.w3.org/TR/html4/loose.dtd">*
    *<%@ page contentType="text/html;charset=UTF-8"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>*
    *<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>*
    *<%@ taglib uri="http://xmlns.oracle.com/adf/faces/rich" prefix="af"%>*
    *<f:view>*
    *<af:document id="d1">*
    *<af:messages id="m1"/>*
    *<af:form id="f1">*
    *<af:table value="#{bindings.perInfoAll1.collectionModel}" var="row"*
    *rows="#{bindings.perInfoAll1.rangeSize}"*
    *emptyText="#{bindings.perInfoAll1.viewable ? 'No data to display.' : 'Access Denied.'}"*
    *fetchSize="#{bindings.perInfoAll1.rangeSize}"*
    *rowBandingInterval="0"*
    *selectionListener="#{bindings.perInfoAll1.collectionModel.makeCurrent}"*
    *rowSelection="multiple" id="t1">*
    *<af:column sortProperty="uname" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.uname.label}"*
    *id="c1">*
    *<af:inputText value="#{row.bindings.uname.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.uname.label}"*
    *required="#{bindings.perInfoAll1.hints.uname.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.uname.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.uname.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.uname.tooltip}"*
    *id="it3">*
    *<f:validator binding="#{row.bindings.uname.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="firstName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.firstName.label}"*
    *id="c2">*
    *<af:inputText value="#{row.bindings.firstName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.firstName.label}"*
    *required="#{bindings.perInfoAll1.hints.firstName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.firstName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.firstName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.firstName.tooltip}"*
    *id="it2">*
    *<f:validator binding="#{row.bindings.firstName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *<af:column sortProperty="lastName" sortable="false"*
    *headerText="#{bindings.perInfoAll1.hints.lastName.label}"*
    *id="c3">*
    *<af:inputText value="#{row.bindings.lastName.inputValue}"*
    *label="#{bindings.perInfoAll1.hints.lastName.label}"*
    *required="#{bindings.perInfoAll1.hints.lastName.mandatory}"*
    *columns="#{bindings.perInfoAll1.hints.lastName.displayWidth}"*
    *maximumLength="#{bindings.perInfoAll1.hints.lastName.precision}"*
    *shortDesc="#{bindings.perInfoAll1.hints.lastName.tooltip}"*
    *id="it1">*
    *<f:validator binding="#{row.bindings.lastName.validator}"/>*
    *</af:inputText>*
    *</af:column>*
    *</af:table>*
    *</af:form>*
    *</af:document>*
    *</f:view>*
    but when run it i see the following errors
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    *Class oracle.adf.model.adapter.bean.BeanDataControl can not access a member of class nl.amis.hrm.EmpManager with modifiers "private"*
    *Object EmpManager of type DataControl is not found.*
    *java.lang.NullPointerException*
    :(

  • How to get security roles in a JSF portlet

    I need to get the LDAP user-roles available in the Sun Portal Server 7 in my JSF-168 portlet.
    I've added the mapping file, updated the portlet.xml and web.xml, deployed the portlet (psconsole). But the portlet shows the "content not available" error with javax....title title.
    I've probably messed up the descriptors, but I don't see what is wrong. Here they are:
    roleMaps.properties
    cn\=VSM.Administrator,dc\=neco,dc\=cz=Administrator
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.4">
      <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
      </context-param>
      <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/navigation.xml,/WEB-INF/managed-beans.xml</param-value>
      </context-param>
      <context-param>
        <param-name>com.sun.faces.validateXml</param-name>
        <param-value>true</param-value>
      </context-param>
      <context-param>
        <param-name>com.sun.faces.verifyObjects</param-name>
        <param-value>false</param-value>
      </context-param>
      <filter>
        <filter-name>UploadFilter</filter-name>
        <filter-class>com.sun.rave.web.ui.util.UploadFilter</filter-class>
        <init-param>
          <description>
              The maximum allowed upload size in bytes.  If this is set
              to a negative value, there is no maximum.  The default
              value is 1000000.
            </description>
          <param-name>maxSize</param-name>
          <param-value>1000000</param-value>
        </init-param>
        <init-param>
          <description>
              The size (in bytes) of an uploaded file which, if it is
              exceeded, will cause the file to be written directly to
              disk instead of stored in memory.  Files smaller than or
              equal to this size will be stored in memory.  The default
              value is 4096.
            </description>
          <param-name>sizeThreshold</param-name>
          <param-value>4096</param-value>
        </init-param>
      </filter>
      <filter-mapping>
        <filter-name>UploadFilter</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
      </filter-mapping>
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet>
        <servlet-name>ExceptionHandlerServlet</servlet-name>
        <servlet-class>com.sun.errorhandler.ExceptionHandler</servlet-class>
        <init-param>
          <param-name>errorHost</param-name>
          <param-value>localhost</param-value>
        </init-param>
        <init-param>
          <param-name>errorPort</param-name>
          <param-value>25444</param-value>
        </init-param>
      </servlet>
      <servlet>
        <servlet-name>ThemeServlet</servlet-name>
        <servlet-class>com.sun.rave.web.ui.theme.ThemeServlet</servlet-class>
      </servlet>
      <servlet>
        <description>Generated By Sun Java Studio Creator</description>
        <display-name>CreatorPortlet Wrapper</display-name>
        <servlet-name>VSMPortal</servlet-name>
        <servlet-class>org.apache.pluto.core.PortletServlet</servlet-class>
        <init-param>
          <param-name>portlet-class</param-name>
          <param-value>com.sun.faces.portlet.FacesPortlet</param-value>
        </init-param>
        <init-param>
          <param-name>portlet-guid</param-name>
          <param-value>VSMPortal.VSMPortal</param-value>
        </init-param>
      </servlet>
      <servlet-mapping>
        <servlet-name>ExceptionHandlerServlet</servlet-name>
        <url-pattern>/error/ExceptionHandler</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>ThemeServlet</servlet-name>
        <url-pattern>/theme/*</url-pattern>
      </servlet-mapping>
      <servlet-mapping>
        <servlet-name>VSMPortal</servlet-name>
        <url-pattern>/VSMPortal/*</url-pattern>
      </servlet-mapping>
      <welcome-file-list>
        <welcome-file>faces/null</welcome-file>
      </welcome-file-list>
      <error-page>
        <exception-type>javax.servlet.ServletException</exception-type>
        <location>/error/ExceptionHandler</location>
      </error-page>
      <error-page>
        <exception-type>java.io.IOException</exception-type>
        <location>/error/ExceptionHandler</location>
      </error-page>
      <error-page>
        <exception-type>javax.faces.FacesException</exception-type>
        <location>/error/ExceptionHandler</location>
      </error-page>
      <error-page>
        <exception-type>com.sun.rave.web.ui.appbase.ApplicationException</exception-type>
        <location>/error/ExceptionHandler</location>
      </error-page>
      <jsp-config>
        <jsp-property-group>
          <url-pattern>*.jspf</url-pattern>
          <is-xml>true</is-xml>
        </jsp-property-group>
      </jsp-config>
         <security-role>
              <role-name>Administrator</role-name>
         </security-role>          
    </web-app>
    portlet.xml
    <?xml version='1.0' encoding='UTF-8' ?>
    <portlet-app xmlns='http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd                         http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd' version='1.0'>
         <portlet>
              <description>Created By Java Studio Creator</description>
              <portlet-name>VSMPortal</portlet-name>
              <display-name>VSMPortal Portlet</display-name>
              <portlet-class>com.sun.faces.portlet.FacesPortlet</portlet-class>
              <init-param>
                   <name>com.sun.faces.portlet.INIT_VIEW</name>
                   <value>/Uctarna.jsp</value>
              </init-param>
              <expiration-cache>0</expiration-cache>
              <supports>
                   <mime-type>text/html</mime-type>
                   <portlet-mode>VIEW</portlet-mode>
              </supports>
              <supported-locale>en</supported-locale>
              <portlet-info>
                   <title>VSMPortal</title>
                   <short-title>VSMPortal</short-title>
                   <keywords>Creator</keywords>
              </portlet-info>
              <security-role-ref>
                   <role-name>Administrator</role-name>
                   <role-link>Administrator</role-link>
              </security-role-ref>          
         </portlet>
    </portlet-app>If I don't use the security-role and security-role-ref tags, the portlet works, and the isUserInRole method obviously doesn't.

    Nobody uses the LDAP roles in a portlet? Anybody knows other thread discussing similar issue (I can't find anything)?

  • JSF Pages are not rendering correctly when  loaded using Non JSF actions

    Hi All,
    This problem is irritating me and I am posting the same query for the third time here.
    When I come from non jsf actions such as page submitting using Javascript, clicking anchor link, clicking normal Html submit button and so on my page is not rendering correctlly .
    In other words, My first GET method/Post method works perfectly for the first time when the page is loaded.
    But when we try to access the page for the second time, although logical work is perfect in bean, I am getting same old page.
    How to resolve this issue?
    or
    Is this Bug of Sun's Implementation of JSF Framework.
    Thanks,
    Sudhakar

    Hi Sudhakar,
    There is a discussion about refreshing a page, Take a look at the below thread
    http://swforum.sun.com/jive/thread.jspa?threadID=55660
    Hope this what you are looking for
    MJ

  • Any way (event) to call Java method after view created in JSF 2.0

    Hi,
    I am using JSF 2.0 Mojarra's implementation.
    I am interested to know if there is a way to call Java methods before and/or after view has been restored.
    I wanted to initialize data for my page in this Java method.
    I could see there is an event class PostRestoreStateEvent added in JSF 2.0. How to use it?
    I tired to use f:event element as below, but it does not work. Can anyone share anyother idea to achieve this behaviour?
    <f:metadata>
    <f:event type="postRestoreState" listener="#{employeeLoadBean.loadAfterRestoreView}"/>
    </f:metadata>
    Regards,
    Kishore K S

    Hi,
    The problem is solved as below.
    <f:metadata>
    <f:event type="javax.faces.event.PostRestoreStateEvent" listener="#{employeeViewEventListener.postRestoreState}"/>
    </f:metadata>
    The above calls the Java method #{employeeViewEventListener.postRestoreState} whenever View has been restored.
    It was not working when shortName of the event (ie., postRestoreState) is given and throwing ClassNotFound exception.
    Regards,
    Kishore K S

  • Can't reference methods in a Bean from a Composite JSF Component.

    I have the following composite component TestCC.xhtml:
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
    xmlns:cc="http://java.sun.com/jsf/composite" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <cc:interface>
    <cc:attribute name="manager" method-signature="java.lang.String helloTest()" required="true"/>
    </cc:interface>
    <cc:implementation>
    Hello #{cc.attrs.manager} !!!!!!!!!!!!!!!!!!!!!
    </cc:implementation>
    </html>
    When I try to call it in a JSFF file:
    <?xml version='1.0' encoding='UTF-8'?>
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:icc="http://java.sun.com/jsf/composite/IchipComponent">
    <icc:TestCC manager="#{viewScope.PatientClinicalBean.helloTest}"/>
    The page crashes at my composite tag with the following message in the console:
    javax.el.ELException: //C:/Documents and Settings/tlam/Application Data/JDeveloper/system11.1.2.3.39.62.76.1/o.j2ee/drs/iCHIP/ViewControllerWebApp.war/WEB-INF/classes/META-INF/resources/IchipComponent/TestCC.xhtml: javax.el.PropertyNotFoundException: //C:/Documents and Settings/tlam/Application Data/JDeveloper/system11.1.2.3.39.62.76.1/o.j2ee/drs/iCHIP/ViewControllerWebApp.war/Patient/Profile/Clinical.jsff @13,86 manager="#{viewScope.PatientClinicalBean.helloTest}": The class 'patient.profile.PatientClinicalBean' does not have the property 'helloTest'.
    But my managed bean does have a public String helloTest() method, as well as other methods that work fine elsewhere in my JSFF page:
    public class PatientClinicalBean{
    String test = "TESTING";
    public String helloTest() {
    return test;
    I have tried this many times with different methods, all with the same result. Yet if my composite component outputs just a string and I enter the expression <icc:TestCC manager="#{viewScope.PatientClinicalBean.test}"/> to access the String test field directly it executes properly. I can't seem to reference any of the methods in PatientClinicalBean from only my composite component, when other method calls work fine in the same JSFF page. All other examples I've seen on the web have no problems doing this the same way I have, am I missing something?!
    Edited by: tnology on 24-Oct-2012 14:13
    Edited by: tnology on 24-Oct-2012 14:14
    Edited by: tnology on 24-Oct-2012 14:16

    What if you change the method in the class like this?
    public String getHelloTest() {
      return test;
    }If you attempt to read a property call abc from a bean, you need to have a method called getAbc(). If you attempt to set a property called abc, you need to have a method called setAbc(...). This is JavaBeans convention.

Maybe you are looking for

  • WRT120N no longer recognized by laptops

    I'm not quite sure where the problem lies, so I'm going to go over everything that happened so I can hopefully get an answer. Any help is MUCH appreciated. We were running a few laptops (Acer Aspire 5517 on Vista) off our WRT120N router wirelessly. W

  • 2.4 Camera Raw update Glitch

    I applied latest CR 2.4 upgrade to G5Quad and found that .dng files produced using Phocus software as a workaround are showing up at least 2 stops under exposed with nowhere left to go on the slider to correct. Any one seeing a similar problem Phil T

  • Display Current Quarter and Previous Quarter???

    Hi Gurus, I Had a requirement to display only the current Quarter and previous quarter in the report level using single quarter column. and my quarter value type is Q1 2013. Please anyone help me out on this asap/ Thanks.

  • Send mail in Unix

    Dear Friends, I have a shell script that sens mails like this: /usr/lib/sendmail -v ${CPA_ADMIN} where variable CPA_ADMIn is assigned as CPA_ADMIN="[email protected]" Please can you help me in this case. I want to know if 1. i can specify more email

  • Stop xjc generating entire include file

    I have defined a whole bunch of elements in a schema (m_fields.xsd). Another schema (myclass.xsd) uses an <xsd:include> to include m_fields and points to some of its fields (using ref="m_fields fieldname"). My problem is this : when I use xjc.bat to