comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * My understanding in "new" keyword - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/62e90e8bce4915a9 * accesing a constants file from tiles-defs.xml - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e4dfc61706c64040 * Java Help website - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/972c142d78650ed5 * Why cannot open .txt file with Encoding = UNICODE using javascript window.open()? - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/14899a162cf7e7f8 ============================================================================== TOPIC: My understanding in "new" keyword http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/62e90e8bce4915a9 ============================================================================== == 1 of 2 == Date: Mon, Nov 29 2004 9:40 pm From: "Bruce Sam" I think,if not use the "new" keyword,it will not create an object,only create a reference.For example,"String str = "ab";" only create a reference.But when I use "String str = new String("ab");",here will create an string object and a reference str point to it. Is it right? == 2 of 2 == Date: Tues, Nov 30 2004 1:51 am From: "hilz" "Bruce Sam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I think,if not use the "new" keyword,it will not create an object,only > create a reference.For example,"String str = "ab";" only create a > reference.But when I use "String str = new String("ab");",here will > create an string object and a reference str point to it. > Is it right? > No quite. in both cases you will get a reference to a String object. String str1="ab";// gives you a reference to a string from the string pool. if it does not already exist, it is created. String str2="ab";// again will give you a reference to the same "ab" in the line above. String str3= new String("ab");// this will always creates a new String object. str1==str2 will give true because str1 and str2 are two references to the same object (a sting in the string pool). str1==str3 will give false because str3 is reference to a new string object created using "new" str1.equals(str3) will give true because the value of str1 is equal to str3 In general, you would rarely need to create a string like str3 was created. you should almost always do it as in str1. To compare strings, you will most probably want to use equals(...). HTH hilz ============================================================================== TOPIC: accesing a constants file from tiles-defs.xml http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e4dfc61706c64040 ============================================================================== == 1 of 1 == Date: Tues, Nov 30 2004 5:47 am From: "nooobody" We are using "useAttribute" in the tiles-defs file of an application to set a value that is used by a custom Struts tag. This works fine; however, I had to hard code the values in the tiles-defs. I also have a class of constants that define the values that represent the different points in a workflow. These constants are used by the custom tag to calculate what subsections of a menu to display and what graphic to display beside each submenu item. Is there a way to gain access to the constants file from tile-defs so I could just use the constant name rather than literals? If so, an example would be a huge help. Thanks! Tim B ============================================================================== TOPIC: Java Help website http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/972c142d78650ed5 ============================================================================== == 1 of 1 == Date: Tues, Nov 30 2004 6:31 pm From: "TTR_Driver" I am a very beganner in Java and I am looking for some Java Help Website (other then Java Sun Website), I hope someone can help.. Thank you very much!! ============================================================================== TOPIC: Why cannot open .txt file with Encoding = UNICODE using javascript window.open()? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/14899a162cf7e7f8 ============================================================================== == 1 of 2 == Date: Mon, Nov 29 2004 11:43 pm From: [EMAIL PROTECTED] (ml) I wrote the following code to open text file: var features = 'toolbar=no,location=no,directories=no,status=yes,menubar=yes,title=no,scrollbars=yes, width=600,height=450'; window.open(url, 'XXX', features); I found that when the file is with encoding = UNICODE, a system message wlll be prompted: "Some files can harm your computer. If the file information below look suspicious, or you do not fully trust the source, do you open or save the file." When I choose "open", there is an error saying that file cannot be found in temporary internet file folder. However, if I choose "save", I can save the file sucessfully to my computer. I tested that if the file with encoding=UTF-8, it can be opened using javascript window.open() method!!! do anyone why the file cannot be "open"? BTW, I need to generate the text file using Java on Solaris platform, do unicode text file can be read on Solaris?? Many thanks for answering my question. == 2 of 2 == Date: Mon, Nov 29 2004 11:46 pm From: [EMAIL PROTECTED] (ml) I cannot directly open the text file with Encoding = UNICODE using the javascript window.open() method, do anyone know why?? Thanks a lot! ============================================================================== You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer" group. To post to this group, send email to [EMAIL PROTECTED] or visit http://groups-beta.google.com/group/comp.lang.java.programmer To unsubscribe from this group, send email to [EMAIL PROTECTED] To change the way you get mail from this group, visit: http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe To report abuse, send email explaining the problem to [EMAIL PROTECTED] ============================================================================== Google Groups: http://groups-beta.google.com
