How to make my java bean internationalization?

hi,
I have a project on tomcat. I have rewrite my jsp to multi-language according to user's browse language setting. User's language is English, the jsp shows them English. User's language is Chinese, the jsp shows them Chinese, and so on. But in my java bean code, some exception are thrown out with some message or alert. Can anybody tell me how to make these java beans show the language string acording to user's browse language setting?
thx
Pierre

Dear one_dane,
Thank you. That is a great document to me. The fact is that my owner code throws exception with a string. The code is:
if(amount<0) throw new Exception("Please input correct amount.");
If the code is in jsp, I can convert it to a internationalized String using struts tag <bean:message...>. But it is in a deep function of java class. So must I add a Locale object parameter to the function and all calling functions?
thx
yours,
Pierre

Similar Messages

  • How to make view Java Bean as .ocx file.

    Hi All,
    I want to use a visual Java Bean in Visual basic. So that I can modify all the bean properties as modify properties in a ocx file.
    I used ActiveX Com bridge downloaded from Sun's site. But the packager
    makes a .tlb file .
    This file can only be added as a reference in visual basic but not as a ActiveX control. Is there any way out to do that???
    Thanks & regards.
    Nimesh

    The packager creates a registry file and a tlb file.
    After registering this .reg file, java bean can be used as an ActiveX control.
    From within Visal Basic, select the "Tools" menu and "Custom Controls" item and add the Bean control that was generated.
    Avinash.

  • How to make a Java program that recognises a function of two variables...

    How to make a Java program that recognises a function of two variables to assign values to that?
    First I will give an example and then do the question.
    Ex1.
    We have any function, eg.y = x ^ 2 + 1 (read 'y' equals 'x' high to the square), a function of the second degree.
    To build the graph of this function attach values to 'x' to find the values of 'y'
    And thus mount the pair ordered (x, y) which represents a point on the Cartesian plane.
    Assigning values to 'x' 'we can build up a table that gives us the pairs ordered:
    We can use any numbers, but arfer interval [-3.3]
    X | y = x ^ 2 + 1
    -3 | Y = (-3) ^ 2 +1 = 10
    -2 | Y = (-2) ^ 2 +1 = 5
    -1 | Y = (-1) ^ 2 +1 = 2
    0 | y = (0) ^ 2 +1 = 1
    1 | y = (1) ^ 2 +1 = 2
    2 | y = (2) ^ 2 +1 = 5
    3 | y = (3) ^ 2 +1 = 10
    We then ordered the pairs:
    (-3.10), (-2.5); (-1.2), (0,1), (1,2), (2,5), (3,10)
    Tabem that can be represented by a table:
    X | y
    -3 | Y = 10
    -2 | Y = 5
    -1 | Y = 2
    0 | y = 1
    1 | y = 2
    2 | y = 5
    3 | y = 10
    Now I begin to explain my doubts.
    See this program:
    Ex2
    * To change this template, choose Tools | Templates
    * And open the template in the editor.
    Encontrando_o_valor_de_y package;
    * @ Author des Soldat Gottes
    Import javax.swing.JOptionPane;
    Public class (Main
    * @ Param args the command line arguments
    Public static void main (String [] args) (
    Int x, y;
    String x1;
    X1 = JOptionPane.showInputDialog ( "We have the function y = x + 1 \ n" +
    "Assign a value for 'x',"); / / receives a value for the function y = x + 1
    X = Integer.parseInt (x1); / / tranforma String in int
    Y = x + 1; / / receives the value of 'x' and calculates' y '
    JOptionPane.showMessageDialog (null, "The value of 'y' is: \ t \ t" + y);
    / / Displays the value of 'y'
    System.exit (0);
    We see that the program receives above a value for 'x' and replaces the function contained in the program, y = x + 1, and so is the value of the variable 'y'.
    In: x1 = JOptionPane.showInputDialog ( "We have the function y = x + 1 \ n" +
    "Assign a value for 'x',");
    The entry is a number and that number is assigned aa ja existing function in the (y = x + 1).
    The question is: would it be possible to come to a function?
    Ex: the program ask: DIGITE THE FUNCTION?
    The USUARIO DIGITARIA A FUNCTION ANY, TYPE: y = x ^ 2 +1
    The program would recognize the function and give numerical values to that function as Ex1, at the beginning of this text.
    And then to find the values of the x and y launch a table.
    It would be possible that?
    By invez of entering with a number so that the program sustitua a function ja existing as Ex2, seen above, entering with a function quaquer (type: y = x ^ 2 +1) for the program atribuisse values to that function and then create a table of values as Ex1.
    I hope it has been easier to understand my doubts now.
    Thank you for your attention!
    God bless!

    rafaelmenezes wrote:
    Thanks for the explanation, could understand what fly said.
    But as it applied to a program?
    How to create a program that recognizes that the entry coefficients?Are you asking about how to parse out the coefficients from the string "3x^4 + 4x^3 - 8x^2 + 5x^1 + 2x^0"? If you define the format to strictly follow that example, this should get you started:
    Strip out the spaces
    Split the String on "x^"
    That should give you [3, 4+4, 3-8, 2+5, 1+2, 0]
    Split each resulting String on "+ | -", preserving the operator as a token so you can apply the correct sign to the coeff.
    That should leave you with [3, 4, +, 4, 3, -, 8, 2, +, 5, 1, +, 2, 0]. Every other number is a coeff, the rest are the degrees.
    You can strip out the +, since those coeffs are already positive, and strip out the - after negating the following number. This is all assuming that you have to write this yourself. There is no doubt already a library or 5 out there that does this for you.

  • How to attach a java bean in forms6i

    Hi,
    I am new to oracle forms6i. i just want to ask on how to attach a java bean to forms6i.i did putting the full directory path to the implementation class but it has an error, bean not found. what should i do?
    Your help is highly appreciated.

    The implementation class should contain the package and class name of the bean e.g. com.groundside.beans.DateFieldBean, not a directory location. The bean itself is loaded from the JAR files specified to be downloaded with the applet.
    If you are running client server then you can't use JavaBeans this way - it's a web only feature.

  • How to make a java program, that can be used by c++ application

    I'm developing a Java web application (WEBapp), but I have also a c++ program.
    C++ program must use WEBapp method to communicate on the web.
    How to make a Java public function that accept value, elaborate, then return the resul to c++ application?

    jschell wrote:
    You have C code.
    You have Java code.
    The two must communicate.I have a c++ program, and a Java program.
    C++ program wants to communicate on the web (send text), and I'm trying to add this functionality to it creating a Java program.
    NOW THE PROBLEM? How c++ program can use java-program (in local) to send data on the web?
    You can just JNI to communicate either from java to C++ or from C++ to java. That is direct communication in that there is a single process involved. Thus you will no longer have a java application and a C++ application but rather a single application.I don't know JNI, i found http://java.sun.com/docs/books/jni/ and I think is too difficult to implement?
    You can use files or sockets to communicate. Using sockets allows for any number of additional protocols including the previously mentioned web services. Those methodologies would allow more than one application to exist.I developed yesterday a java-side-interface using socket (in local host 127.0.0.1). So the c++ program must write or read to/from the socket to comunicate to java (then the java program send data on the web).
    Finally it might be the case that you have a C++ application which you cannot modify. In that case then you MUST use whatever input/output mechanism that it supports. There is no choice. And until you have fully determined what those mechanisms are it is pointless to discuss a solution.I can modify the application, but I don't have developed it. The c++ application use a third-part dll (taken from SKYPE) to comunicate on the web: I have to remove the dipendence from this dll, and add the java program: java program must substitute the dll. It must be non-invasive to the c++ program. DLL calls can be "send(data)" or "receive(data)" or similar.
    For this do you think that JNI is a must, or I can use soket on local host?

  • How to make a Java application that will change the client box's IP address

    HI how to make a Java application( that application would be run on the client ) that will change the client box's IP address ( IP address of itself )

    If you can do that through the command line, then use Runtime.getRuntime().exec(...) to execute your command.

  • How to use/configure JAVA beans file in Forms10g?

    Hi!
    I'm using Forms10g. I need to use few java beans file in my forms. How do i call it and configure it. So, that i can access all the features of this file in Forms.
    Regards.
    Satyaki De.

    Hello,
    Java Beans Integration
    http://forms.pjc.bean.over-blog.com/article-4018331.html
    Hope it helps,
    Jose.

  • How i can run java bean

    i want to run java bean at bean area. i write a simple bean and what i will write on oracle forms builder bean area property palette implementation class. i make bean a jar file and i put it same folder with form file.
    thanks for your helps

    Hello,
    I did not see any error mentioned in your initial post...
    So, what is the error ?
    If the jar file is not in your registry, you could have the design time error (bean not found), but is the bean runs ok at runtime ?
    Francois

  • How to make validation in Bean and select value from another table

    I want to know how to select data from table in backing bean according to primary key i have
    the problem is that
    i have a table Employee_Salary contains Employee ids and their salary
    Empoloyee_Salary table
         Employee_ID      Number
         Employee_salary Number
    And Another table Called Employees
    Employees table
         Employee_ID     Number
         IsManager Varchar2 its value is [*Yes or NO*]
    and other columns that i don't care about this table
    i have on a jsff page an <af:table> this table is editable this is the Empoloyee_Salary table
    *i want to check before save or after insert if this employee is Manager [from Employees tabke(yes or no)] the salary*
    cannot be less that 100
    i want to know how to make this how to select the value from employees table according to the id i have in the employee_salary table how to make this and make this validation
    i have to select IsManager from Employees Table to see if this manager or no
    i want to know how to make this in a bean
    i use jdeveloper 11g
    and my project is ADF Fusion project
    and the page that have the Emplpyee_Salary table is JSFF
    thanks in advance

    You might want to write this code in a validator on the entity object if it should apply from every screen.
    If you want to access view objects from a backing bean the basics are here: http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcservices.htm#sthref918

  • How to make a java portlet using workshop?

    I installed weblogic 8.1 portal and the jsr168 support package.
    Can I make a java portlet (not jsp/html) using workshop? How?
    If I can, to make a new portlet should I drag a class file or java file to portal
    Thanks,
    Jason

    In workshop do:
    F1 (for help)
    Take a look at
    => Tutorials => Portal tutorial
    Geoffrey
    "Jason" <[email protected]> schreef in bericht
    news:3f9700f0$[email protected]..
    >
    I installed weblogic 8.1 portal and the jsr168 support package.
    Can I make a java portlet (not jsp/html) using workshop? How?
    If I can, to make a new portlet should I drag a class file or java file toportal
    Thanks,
    Jason

  • How to make The Java Screen Recorder similar to this one?

    Can u talk about this how can make this code with java?
    http://www.devharbor.com/java/300-Screen-Recorder.html
    The author of this application says this maked by Java Swing.
    My Question is:
    What is Java Swing?
    It's easy to make this app?
    What API/Component needed for export video to MP4 Format like this application?
    How can make a similar application for education purpose with Java.
    Thanks

    808154 wrote:
    :) Thank you for answering my question,
    but impossible in nothing bro, Yea, that's what Aleksey Vayner claimed and he didn't do so well.
    I need to know about swing and start to work with java to develop this software and if I need some help I ask here.Clearly yes. You also need to make simple programs and practice for a long time before you're gonna be able to write a screen recorder with MP4 output.
    I try to develop this before 3-4 years ;)I guess 3-4 years is a realistic goal, if you really concentrate on learning Java.

  • How can i use JAVA BEAN and JSP?

    well, i have developed all my web apps by using pure JSP only, i know this sucks, but i dont know how to start on using beans... what directory should i put them into... etc... what are the good programminmg practices/standards/techniques when incorporating beans in jsp???

    Standards are pretty loose, but generally, Beans hold a lot of the backend logic for your JSP. This can include data validation before entering into the database, database inserts, queries, data manipulation. The JSP should really only contain code that will retrieve the data from the bean and appropriately output it.
    As far as using them, you can use the <jsp:useBean> tag in your JSP. As long as the bean is stored somewhere that your classpath points to, you're all set. From then on, you can use it like any other object in your JSP.

  • How to make a java program run as a background process.

    </pre>
    writing a client server application.
    a program is supposed to run on a the client right from the time the client turns on the computer till the computer is turned off.
    the catch is the client should all the time be unaware of the program running in his computer, no dos prompt window, no icon on the taskbar,etc. can i convert it the class file into an exe file through software and put the exe filename in autoexec.bat. But then i think that the dosprompt window will open up on starting, but the client should see nothing.
    please help
    </pre>

    </pre>
    Thanks Daniel and jesper,
    could not really fully understand what you mean.
    creating a batch file is okay, but do you configure it
    to run in a an hidden mode.
    Also I have no idea of how to make a window
    service.can you please elaborate a bit
    </pre>

  • How can I include Java Bean model into the model outside the component

    Hi All,
    I am new to SAP portal. I wanted to create a bean for storing the data and to include that into the application model.
    Please help me with an example .
    Regards,
    Saroj

    Hi,
      Check these blogs.
    The specified item was not found.
    Importing Complex JavaBean model into WebDynpro by creating relationships for the model classes
    JavaBean Model Import: when it really works
    Issue in Importing Java Bean Model
    Regards,
    Harini S
    Consider rewarding points for helpful answers. Post this thread in WD forums for more results.

  • How Get ICubeContext at Java bean (Spring Context)

    Hello,
    I need to get the ICubeContext in a Java Bean (Spring Context). Is possible?
    For example in a custom xpath fuction, is very easy:
    public Object call(IXPathContext context, List args) throws XPathFunctionException {
        Map props = (Map) context.getVariableValue(null, null, "xpath-function-data");
        ICubeContext ctx = (ICubeContext) props.get("ICubeContext");
    I would appreciate any help. Thank you very much!
    Sergio.

    This is a possible solution:
    BPELContext bc = BPELContext.peekThreadBPELContext();
        if (bc == null)
          return null;
        ICubeContext ctx = bc.getCubeContext();
    not yet tested!!

Maybe you are looking for

  • How can I migrate my itunes music and playlists from my old PC to my new macbook?

    Hi I have a approx 250 GB of music and itunes content to move to my new macbook pro (running Lion) from my PC laptop (Windows 7) I'd like to retain all the playlists that I have painstakingly built over the past few years but I dont want to rebuild t

  • System crash while printing to Acrobat printer

    This is something that has annoyed me for a long time, sometimes while printing to Acrobat (making a PDF), the computer hangs and I have to turn the power off on the computer to shut down. I had this issue with version 7 and when I updated to version

  • I need help urgent please :(

    Hi i'm too much worried about my laptop because before 1 hours its working perfectly and while i working on my laptop suddenly laptop is off and now when i presss power on button its on for 4 seconds with a fast fan voice and no display on screen and

  • How to assign a query to a web template in WAD

    Hello experts, How do I assign the web template to the actual query? I have a new template wich is a copy of 0ADHOC which I would like to use for a certain query. Is it sufficient to assign the template of interest in TC 'RSCUSTV21' (standard web tem

  • (Old) LIS in (new) R/3 4.7 (Enterprice) & BW 3.5, a pain in the b...

    Hi, Yep it's LIS again. Unfortunately I could not find the answer the our specific issue on the forum (nor at SAP-Help). We are using the (old) LIS structures S001, S011, S013 & S015 in a R/3 v. 4.7 (latest plugins) & BW 3.5 Environment (as there are