comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Scripting a Java applet stopped working after reinstall of XP... - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1c862ec1af2c6725 * Can someone use invokeLater() to call a public method from a JPanel? - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/70ac1bf0cc54a090 * multiple statement objects per connection - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c8c89dc8f7a169a2 * session tracking question - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8d0c2ee0275a35cb * inner class, explicit outer class method call - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c5b10a57b7a8d571 * exception in HttpConnection.run - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20c2e3d67b62e212 * Am I the only one who questions JSTL, Struts Tags, XSL Tags? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48683f1f07068c7d * Convert UTF-8 encoded data from file into unicode escape - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/518625c508ec82f8 * Map that takes a pair of keys? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b8bfed67959eb893 ========================================================================== TOPIC: Scripting a Java applet stopped working after reinstall of XP... http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1c862ec1af2c6725 ========================================================================== == 1 of 2 == Date: Sat, Oct 23 2004 8:32 pm From: "Alfred Z. Newmane" <[EMAIL PROTECTED]> Real Gagnon wrote: > "Dag Sunde" <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > >> I've been working on a system that have been running >> for the last couple of years, but stopped working >> on my dev. machine after reinstalling WinXP yesterday. > > If you access the Applet from HTML or Javascript you are supposed to > have > > <PARAM name="scriptable" value="true"> > this is needed for tthe plugin 1.4 or better. > > > You have <param name = "mayscript" value ="true"/> which is useful > only when you access javascript or DOM element from Java. > > Also you said that you have the plugin 1.4.2 but in the OBJECT tag you > have a reference to the version 1.3 He could also be missing the JVM for what ever browser he is using (IE?), as IE6 stopped coming with a JVM. You can use MS's or Sun's. == 2 of 2 == Date: Sat, Oct 23 2004 11:24 pm From: Andrew Thompson <[EMAIL PROTECTED]> On Sat, 23 Oct 2004 20:32:51 -0700, Alfred Z. Newmane wrote: (VM's) > You can use MS's or Sun's. Find out which.. <http://www.physci.org/pc/property.jsp?prop=java.version> [ X-post retained. ] HTH -- Andrew Thompson http://www.PhySci.org/codes/ Web & IT Help http://www.PhySci.org/ Open-source software suite http://www.1point1C.org/ Science & Technology http://www.LensEscapes.com/ Images that escape the mundane ========================================================================== TOPIC: Can someone use invokeLater() to call a public method from a JPanel? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/70ac1bf0cc54a090 ========================================================================== == 1 of 3 == Date: Sat, Oct 23 2004 9:36 pm From: "Thomas G. Marshall" <[EMAIL PROTECTED]> Alex Hunsley coughed up: ...[thwack]... > Anyway, sounds like you're > suffering Constructoritis, the disease of doing far too much in > constructors. Perhaps. Seen it many times. > Constructors should do very little - store passed in > values, usually; constructors should *not* call non-final or > non-private methods Overly strict. I cannot /count/ the number of times I've seen horribly convoluted code set out to avoid putting nearly /anything/ into a constructor. You need limits of course, but you need to weigh that against the often /severe/ readability/maintainability/pollution cost of doing it "the right way". > , and constructors shouldn't be doing GUI related > things. Constructors of GUI descendents should, and are often best designed when they do. > Factor out that stuff into other method(s) that you call > after the Constructor has done its stuff. Doing this may solve your > problems. Possibly true. -- "It's easier to be terrified by an enemy you admire." -Thufir Hawat, Mentat and Master of Assassins to House Atreides == 2 of 3 == Date: Sun, Oct 24 2004 1:32 am From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> "***C.Steamer***" <[EMAIL PROTECTED]> writes: > Yeah thanks for nothing dude, If you don't have anything useful to > add don't say anything. Top-posting a snide remark like that in a follow-up to a post that DID have something useful is a quick way to be added to people's kill-files. == 3 of 3 == Date: Sun, Oct 24 2004 2:41 am From: Alex Hunsley <[EMAIL PROTECTED]> Thomas G. Marshall wrote: > Alex Hunsley coughed up: > > ...[thwack]... > > >>Anyway, sounds like you're >>suffering Constructoritis, the disease of doing far too much in >>constructors. > > Perhaps. Seen it many times. > > > >>Constructors should do very little - store passed in >>values, usually; constructors should *not* call non-final or >>non-private methods > > > Overly strict. I cannot /count/ the number of times I've seen horribly > convoluted code set out to avoid putting nearly /anything/ into a > constructor. "Constructors should *not* call non-final or non-private methods" is not overly strict - it's actually a very good idea. Otherwise, you can get into some very strange problems, due to way the order in which JVM intialises class members and calls super etc. - I've seen these problems first hand and I've seen people waste *ages* on them because they didn't know what was happenig. (It's not obvious if you don't know about the thing I'm talking about above.) >You need limits of course, but you need to weigh that against >the often /severe/ readability/maintainability/pollution cost of doing >it "the right way". I don't see how "often severe" problems can arise as a result of not having so much code in the constructor, and having mode code in other (well named) methods, which makes things more explicit. Do you have any solid-ish examples of that? >>, and constructors shouldn't be doing GUI related >>things. > > > Constructors of GUI descendents should, and are often best designed when > they do. Obviously, that is a good exception. I thought of that when I posted but I thought it too obvious to put in. >> Factor out that stuff into other method(s) that you call >>after the Constructor has done its stuff. Doing this may solve your >>problems. > > > Possibly true. ========================================================================== TOPIC: multiple statement objects per connection http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c8c89dc8f7a169a2 ========================================================================== == 1 of 1 == Date: Sat, Oct 23 2004 10:34 pm From: "Madhur Ahuja" <[EMAIL PROTECTED]> Mark Thornton <[EMAIL PROTECTED]> wrote: [snip] > All the work for the first statement is complete before you start the > second. Try doing two select statements and read say only half of the > results from the first ResultSet before executing the second statement > and then see if you can continue reading the remainder of the results > from the first ResultSet. Its still not clear. The program clearly runs without any errors. See the new program : import java.sql.*; class Test { public static void main(String args[]) { MyTest a=new MyTest(); } } class MyTest { MyTest() { try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String url="jdbc:Odbc:test"; Connection con=DriverManager.getConnection(url,"",""); Statement st=con.createStatement(); Statement st1=con.createStatement(); st.execute("select * from table1"); ResultSet rs=st.getResultSet(); rs.next(); System.out.println(rs.getString(1)); st1.execute("select a from table1"); ResultSet rs1=st.getResultSet(); rs1.next(); System.out.println(rs.getString(2)); rs.next(); System.out.println(rs.getString(1)); System.out.println(rs.getString(2)); st.close(); con.close(); } catch(Exception e) { e.printStackTrace(); } } } -- Madhur Ahuja [madhur<underscore>ahuja<at>yahoo<dot>com] Homepage http://madhur.netfirms.com ========================================================================== TOPIC: session tracking question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/8d0c2ee0275a35cb ========================================================================== == 1 of 3 == Date: Sat, Oct 23 2004 10:22 pm From: "Madhur Ahuja" <[EMAIL PROTECTED]> Hello In the servlets API there are two sets of *setAttribute* and *getAttribute* functions, one of which is in *ServletContext* and other in *HttpSession*. I have used both of them, and they seem to produce same results. javaDoc says: Binds an object to this (session/context), using the name specified. Is there any difference in binding to the session and to the context? -- Madhur Ahuja [madhur<underscore>ahuja<at>yahoo<dot>com] Homepage http://madhur.netfirms.com == 2 of 3 == Date: Sun, Oct 24 2004 1:37 am From: "Tony Morris" <[EMAIL PROTECTED]> The session is associated with a specific user making a request. The servlet context is associated with the entire web application. Try this: Set an attribute in the context; then start a new session (for example, by starting a new browser or some other unassociated HTTP client) and retrieve the value. Now try the same with a session - you'll find there is no value there (because you have a different session). -- Tony Morris http://xdweb.net/~dibblego/ == 3 of 3 == Date: Sun, Oct 24 2004 1:23 am From: Oscar kind <[EMAIL PROTECTED]> Madhur Ahuja <[EMAIL PROTECTED]> wrote: > In the servlets API there are two sets of > *setAttribute* and *getAttribute* functions, one > of which is in *ServletContext* and other in *HttpSession*. > > I have used both of them, and they seem to produce same > results. javaDoc says: > Binds an object to this (session/context), using the > name specified. > > Is there any difference in binding to the session and to > the context? Have you tried this with two users (and thus two sessions?). An object tied to the context is available to all users that access that context. An object ties to a session is only available to the user of that session. -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ========================================================================== TOPIC: inner class, explicit outer class method call http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c5b10a57b7a8d571 ========================================================================== == 1 of 1 == Date: Sat, Oct 23 2004 11:17 pm From: [EMAIL PROTECTED] (Yamin) Oscar kind <[EMAIL PROTECTED]> wrote in message > There is no need to work around it: the methods of the outer class are > available in the inner class. You can just call them. > > It becomes "interesting" when you've hidden the method from the outer > class by declaring a method woth the same name in the inner class. But > even then you can reach it using OuterClass.this.method(). > > It even works with more than methods, but I haven't used if for anything > other than fields yet. > > Thanks all, Learn a new thing everyday :) ========================================================================== TOPIC: exception in HttpConnection.run http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/20c2e3d67b62e212 ========================================================================== == 1 of 1 == Date: Sat, Oct 23 2004 11:42 pm From: [EMAIL PROTECTED] (Itamar Lev) hi, I get the following exception: [08:32:30:847 IST 24/10/04] 6ca86ca8 TraceNLS u No message text associated with key HttpConnection.run:.java.lang.IllegalStateException:.0.response.bytes.written,.but.Content-Length.header.equals.283 in bundle com.ibm.ejs.resources.seriousMessages [08:32:30:847 IST 24/10/04] 6ca86ca8 HttpConnectio E HttpConnection.run: java.lang.IllegalStateException: 0 response bytes written, but Content-Length header equals 283 [08:32:30:956 IST 24/10/04] 6ca86ca8 SystemOut O java.lang.IllegalStateException: 0 response bytes written, but Content-Length header equals 283 I don't know what it is and how to fix it. It's not an exception that stops the program but it's an exception still. Thanks in advance, Itamar Lev ========================================================================== TOPIC: Am I the only one who questions JSTL, Struts Tags, XSL Tags? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/48683f1f07068c7d ========================================================================== == 1 of 1 == Date: Sun, Oct 24 2004 12:46 am From: "Alex Kay" <[EMAIL PROTECTED]> "Greg Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > in our office i recently vented about the constant reintroduction of > the IF/WHILE/FOR/FOREACH tags in <c:> and <x:> and other taglibs. > IMHO, it is a terrible affront to the Java language. We already have > If/While/For/Foreach in Java, adding it to every taglib dilutes the > language. > > Essentially, a taglib is an extension to HTML. I feel that having > multiple IF statements weakens the programming environment. Why not > just use Java's IF. Extending HTML to allow control structures > attempts to make HTML a programming language - which it is not. It is > a markup language. And a pretty decent one at that. But HTML does > not lend itself well to describing programming constructs, in > particular flow control. > > Am I alone in this? Hi, No you're not alone. I also prefer Java for programming and HTML/CSS/WYSIWYGs for presentation. Let each do what it's best at. When the world's collide I found it's easier to handle presentation stuff within Java (after all it's a full-blown language) rather than trying to smuggle more and more programmatic abilities into a graphics world. Mind you I do use JSP/JSTL/EL for prototypes and quick and dirty hacks. Regards. ========================================================================== TOPIC: Convert UTF-8 encoded data from file into unicode escape http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/518625c508ec82f8 ========================================================================== == 1 of 1 == Date: Sun, Oct 24 2004 1:09 am From: [EMAIL PROTECTED] (Fritz Bayer) Alex Kizub <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Fritz: > Convertion from utf-8 to unicode is Java loalization privilege. > So, let Java do what it supposed to do. > > public class a{ > public static void main(String []a) throws Exception { > java.text.DecimalFormat f; > f = new java.text.DecimalFormat(); > f.applyPattern("\\u0000"); > > java.io.FileReader fr=new java.io.FileReader("a.java"); > while (fr.ready()) { > System.out.println(f.format(fr.read())); > } > fr.close(); > } > } > > Alex Kizub. > > Fritz Bayer wrote: > > > Hi, > > > > I'm looking for a little program, which reads utf-8 data from a file > > and writes it in the form of unicode escape into another text file. > > > > Why am I looking for something like this? Well, I have a file which > > contains utf-8 encoded data. > > > > That data I would like to build staticly into my program. So I would > > like to copy and paste it into a String constant (String > > ="\uxxxx\uxxxx..."). > > > > However, since I can't just open up a viewer and copy and paste the > > contents (of course), I would have to convert it into unicode escape. > > > > Then I could copy and paste those escape code into my program. I > > thought that their must be some source code / program aroung which > > does that? > > > > Fritz Thank you Alex. I`m experience a small problem so. Some of the escapes look like: \u65533 ie they are too long. I also noticed that none of the escapes contain hexadecimal, which seems to be wrong since unicode escapes contain them. ========================================================================== TOPIC: Map that takes a pair of keys? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b8bfed67959eb893 ========================================================================== == 1 of 1 == Date: Sun, Oct 24 2004 1:19 am From: Oscar kind <[EMAIL PROTECTED]> marcus <[EMAIL PROTECTED]> wrote: > question about your code, tho [cut some lines] >> if (key1 != null && !key1.equals(o.key1)) > > isn't this last line recursing? No, because it calls equals on a member variable; not on its own object. The method being called is not the same: it has the same name, but belongs to another object (unless key1 has the value this). -- Oscar Kind http://home.hccnet.nl/okind/ Software Developer for contact information, see website PGP Key fingerprint: 91F3 6C72 F465 5E98 C246 61D9 2C32 8E24 097B B4E2 ======================================================================= You received this message because you are subscribed to the Google Groups "comp.lang.java.programmer". comp.lang.java.programmer [EMAIL PROTECTED] Change your subscription type & other preferences: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe Report abuse: * send email explaining the problem to [EMAIL PROTECTED] Unsubscribe: * click http://groups-beta.google.com/group/comp.lang.java.programmer/subscribe ======================================================================= Google Groups: http://groups-beta.google.com
