comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * UnsupportedEncodingException - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f05a57f2fc1fbd14 * newbie - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ca1e2e741e203cc6 * Enterprise Reporting Solution - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/38f07a10dcb1c6ea * Eclipse SWT on MacOSX - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fab439e4b36772c9 * hey i am new to this - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1037fd04428c23dc * Compiling java code from within Java - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7dccb8de6fe57263 * Package jar files inside EJB jar file? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f0cc75e4ca20aad4 * How can I "force" an upcast? Convert subclass into superclass? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ad4bc9f7ae03de71 * Unable to establish a socket connection - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3db1070c05ec0b49 * How to starthandshake with client browser?? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d41b9d8f6879f8b * Environment variable - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e10a85f420f52962 * How to do authentication and include the web page in the mail? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fa76bc88ec2794c3 * CORBA or some other methodology? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a7b217bf697c503b * request.getHeader - referer - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/810ddbb36c621b1f * Percent JFormattedField - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/46a6264dce518fae * tomcat css mime-type - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4f0bba1ea74e6ae5 * Color. - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9cc5c64bd649be2b * Question regarding marker interfaces.... - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cf059e2fa32de473 * SimpleQ - A simple Message Queue Implementation - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4dc30965c39863ae ========================================================================== TOPIC: UnsupportedEncodingException http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f05a57f2fc1fbd14 ========================================================================== == 1 of 3 == Date: Mon, Nov 22 2004 8:18 am From: Andrew Thompson <[EMAIL PROTECTED]> On Mon, 22 Nov 2004 15:45:45 GMT, Bill Lattery via JavaKB.com wrote: > Thanks Andrew! > > You method works. You're welcome. > Now, I have another problem. ... > The problem I have is that not all of the data is encoded properly. Unfortunately encodings are a bit out of my field of expertise. I'll wait to hear what the experts say. -- 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 == 2 of 3 == Date: Mon, Nov 22 2004 8:57 am From: Tor Iver Wilhelmsen <[EMAIL PROTECTED]> "John C. Bollinger" <[EMAIL PROTECTED]> writes: > Documentation has little to do with it. UnsupportedEncodingException > is a *checked* exception that the method being invoked is declared to > be capable of throwing, therefore the method that invokes it must > either catch that exception or declare that it throws it. Sorry, yes, typed a bit fast there: I meant to write checked. == 3 of 3 == Date: Mon, Nov 22 2004 10:28 am From: "John C. Bollinger" <[EMAIL PROTECTED]> Bill Lattery via JavaKB.com wrote: > I am working with a Java-based program that performs SNMP. One of the MIB > variables is a 6 byte octet message stream. The program retrieves the > information and saves it on a table as a String. My part of the code must get > the info as a String. I need to convert the String to a byte buffer. The MIB / SNMP terminology appears to be "octet _string_" (emphasis mine) not "octet message stream". > The problem I have is that not all of the data is encoded properly. That's rather unlikely. It is entirely possible that you don't know how it is encoded, however. > For example: The MIB variable message is (in decimal): 00 04 -127 12 -115 -114 > > When I use the getBytes() function, the byte buffer contains (in decimal): 00 > 04 63 12 63 63. To do this you have already coerced the byte sequence into a String according to some encoding. The byte 63 (decimal) is a '?' in Unicode; it signals that the charset you used does not map the current byte(s) to a character. > I have used the Character Encoding Sets US-ASCII, ISO-8859-1, UTF-8, UTF-16, > UTF-16BE, UTF-16LE, and windows-1252. None have given me the result I need. How would you recognize the result when you got it? If you know what the correct answer is, then that would be very pertinent. > What Character Encoding Set should I use to get the right values? That may be device-dependent. MIB specifies data types in ASN.1, and ASN.1 apparently does not define encodings to use (that's part of the "Abstract" in "Abstract Syntax Notation"). The information is probably carried by some other item in the MIB. Have you considered the possibility that the string is empty? The initial zero byte is very suspicious in that regard. If you are getting fixed-length strings with variable-length content then there will be some kind of fence byte to indicate the end of the meaningful data -- at least when the string is shorter than the maximum length. Compare to C strings. If that's not it then you'll probably need to pass on more information. For what it's worth, the charsets you have already tried cover all the likely ones. John Bollinger [EMAIL PROTECTED] ========================================================================== TOPIC: newbie http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ca1e2e741e203cc6 ========================================================================== == 1 of 2 == Date: Mon, Nov 22 2004 8:36 am From: "Danny Gopie" <[EMAIL PROTECTED]> Hello i want to write a program that reads an integer between 0 and 1000 and summarizes all the digits in the integer. For example, if an integer is 932, the sum of all the digita is 14. Does anyone knows how to do this? Danny == 2 of 2 == Date: Mon, Nov 22 2004 8:44 am From: Eric Sosman <[EMAIL PROTECTED]> Danny Gopie wrote: > Hello > > i want to write a program that reads an integer between 0 and 1000 and > summarizes all the digits in the integer. For example, if an integer is 932, > the sum of all the digita is 14. > > Does anyone knows how to do this? Hint #1: What is the value of `932 % 10'? Hint #2: What is the value of `932 / 10 % 10'? Hint #3: The comp.lang.java.help newsgroup is a more suitable forum for beginners' questions. Follow- ups set. -- [EMAIL PROTECTED] ========================================================================== TOPIC: Enterprise Reporting Solution http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/38f07a10dcb1c6ea ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 8:40 am From: [EMAIL PROTECTED] (Don) Hi There, I am looking for an open source reporting tool that i can use to generate the usual report formats. The tool must be robust and manage high load. the tool will also be used bye quartz scheduler so it must be able to handle many threads of execution. Any help of suggestion on a tool that would suit would be great. ========================================================================== TOPIC: Eclipse SWT on MacOSX http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fab439e4b36772c9 ========================================================================== == 1 of 1 == Date: Sun, Nov 21 2004 6:35 am From: "dr. Hans van der Meer" <[EMAIL PROTECTED]> Does someone know the answer to the following problem: I would like to produce a stand-alone Java Application with Eclipse SWT (Apple MacOSX 10.3.6, Java1.4.2_05, Eclipse_3.1M3). I followed the instructions in the article "Bundling Java/SWT Applications for Mac OS X" by Nathan Callender (September 30, 2004), notably: "CFBundleExecutable: if you are running Java 1.4.2_04 and the Eclipse 3.1 stream, you can use the default Java launcher for Mac OSX (JavaApplicationStub) provided that you also specify the JVMOption: <key>StartOnMainThread</key><true/>". The core of the application bundle was made with Jar-bundler, then the rest of the inner structure added and Info.plist adapted. 1. I am in doubt of the expression "JVMOption:<key> StartOnMainThread </key> <true/>", because in the Apple Documents "Java 1.4 Info.plist Java Dictionary Keys" and "Java 1.4 Virtual Machine Options" neither JVMOption is mentioned (only VMOptions) nor a key StartOnMainThread. 2. Whatever I am trying (and I varies a lot of things in Info.plist), double clicking the bundle doesn't work. Apparently something starts up but then dies as fast as it is started. Not even the older configuration mentioned in the article (with java_swt as starter) works. I would be grateful if someone can point the right way. Thanks in advance, Hans van der Meer ========================================================================== TOPIC: hey i am new to this http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1037fd04428c23dc ========================================================================== == 1 of 2 == Date: Mon, Nov 22 2004 8:49 am From: Andrew Thompson <[EMAIL PROTECTED]> On 22 Nov 2004 07:47:33 -0800, Greg Smith wrote: >> ..You are likely to >> get better responses if you take effort to make your posts easy to read. ... > ...the fact is .. Prove it.. >...that it is faster to type and offers no loss in > readability. ... ..by demonstrating this incisive comprehension in the answers you provide to the next nnn posts where the poster neglects capitalisation. Such efforts would be especially appreciated on the group to which I referred the OP. I will sometimes skip posts when I'm busy for any number of reasons. One of those is that the post more difficult to read than the next, which supports the basic tenet I put forward. "You are likely to get better responses if you take effort to make your posts easy to read." -- 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 == 2 of 2 == Date: Mon, Nov 22 2004 12:05 pm From: "Ann" <[EMAIL PROTECTED]> "Andrew Thompson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On 22 Nov 2004 07:47:33 -0800, Greg Smith wrote: > > >> ..You are likely to > >> get better responses if you take effort to make your posts easy to read. > ... > > ...the fact is .. > > Prove it.. > > >...that it is faster to type and offers no loss in > > readability. ... > > ..by demonstrating this incisive comprehension in the answers > you provide to the next nnn posts where the poster neglects > capitalisation. > > Such efforts would be especially appreciated on the group to > which I referred the OP. > > I will sometimes skip posts when I'm busy for any number of reasons. > One of those is that the post more difficult to read than the next, > which supports the basic tenet I put forward. > > "You are likely to get better responses if you take > effort to make your posts easy to read." > Is it perhaps the second grade (in USA) where one learns about sentences? One reason given is to make the text easier to read and UNDERSTAND. Many people will deny that proper structure is better, it is likely that they feel it would speak negatively to their machismo. They are likely to say that they are 'keepin it real mothe* fuc*er.' But in reality they are ashamed of their skill level in polite society. ========================================================================== TOPIC: Compiling java code from within Java http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7dccb8de6fe57263 ========================================================================== == 1 of 2 == Date: Mon, Nov 22 2004 9:04 am From: "Chris Uppal" <[EMAIL PROTECTED]> Michael Borgwardt wrote: > A compiler API is being planned (JSR 191), but not currently avilable. Oddly, there does seem to be /something/... http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html#proginterface But there's no equivalent section in the documentation for the Windows version of the same tool. -- chris == 2 of 2 == Date: Mon, Nov 22 2004 9:06 am From: Michael Borgwardt <[EMAIL PROTECTED]> Chris Uppal wrote: >>A compiler API is being planned (JSR 191), but not currently avilable. > > > Oddly, there does seem to be /something/... > > http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html#proginterface > > But there's no equivalent section in the documentation for the Windows > version of the same tool. That's what people have been using for years, and it works the same on Windows. It seems to be an acknowledgement of the status quo, to tell people that Sun is aware that many people are using these methods, and reassuring them that they can safely be used - but not anything else. But if JSR 191 gets implemented, I would expect a much richer interface that allows programmatical analysis of compilation errors instead of just dumping it to STDERR. ========================================================================== TOPIC: Package jar files inside EJB jar file? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f0cc75e4ca20aad4 ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 9:38 am From: "harry" <[EMAIL PROTECTED]> I have a enterprise app constisting of 6 EJB's & 1 web component. I want one of the ejb's to control database persistance using the iBatis framework. Where do I put the jar files that make up ibatis in this EJB jar file? - no WEB-INF\lib dir like with web components & trying adding one but seems to ignore it! thanks harry ========================================================================== TOPIC: How can I "force" an upcast? Convert subclass into superclass? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ad4bc9f7ae03de71 ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 9:41 am From: "Mike Schilling" <[EMAIL PROTECTED]> "John C. Bollinger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > >> I'm tempted to go on to discuss the invariant: >> >> a != b -> !a.equals(b) >> >> This is true for objects of type Object(), but overriding equals() can >> violate it. Since I'm not sure if I'm missing your point entirely, I'll >> not do that now. > > Well, now, go ahead and provide a simpler example, why don't you? ;-) The simplest one I can think of is a StringComparator class, say, one to sort strings lexicographically. It has no state, thus all instances are identical [1], so logically it includes the definitions: public int hashCode() { return 1; } public boolean equals(Object o) { return o != null && o.getClass() == this.getClass(); } The program: Object o1 = new Object(); Object o2 = new Object(); return o1.equals(o2); clearly always returns false for Objects, always true for StringComparators 1. It's true that this would probably use the singleton pattern with a non-public constructor. That would make overriding equals() and hashCode() unnecessary. ========================================================================== TOPIC: Unable to establish a socket connection http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3db1070c05ec0b49 ========================================================================== == 1 of 3 == Date: Mon, Nov 22 2004 9:48 am From: [EMAIL PROTECTED] (S J Rulison) Applet Originate I'm not exactly sure what you mean when you say, "the applet is attempting to communicate with the same server from which it originated". Lets say you have a java application file called Server1.class, a java applet called Applet1.class, and an file html called TestApplet.html all stored in designated shared folder on the hard-drive of a PC running Windows XP. The host name for this PC will be JServer. You physically go to the JServer PC, open a command window, CD into the shared folder where the Server1.class resides and start the application from the command line, java Server1 <Enter>. Now you go over to another PC on the network, which is also running Windows XP and logon to the network. We will call this machine JClient. After you logon you map a drive to the shared folder on JServer. You then launch IE and then point to and open the TestApplet.html file in the shared directory on JServer. The TestApplet.html file automatically calls the Applet1.class when it is opened and the Applet1.class then attempts to create a socket connection to the server process that is running on JServer. Here's what I believe is occurring at this point. While the Applet1.class file is stored on the same machine as the Server1.class, I do not believe that is where Applet1 will originat. I believe that the term originate refers to the machine that actually launched the applet, which in this case is the JClient machine. Assuming I am correct with these assumptions, how would you go about getting the Applet1.class to instantiate (originate) itself on the JServer machine from the JClient PC? I have included all of the source code below for this example. I have also included the output that occurs when the applet is called from Jserver and when it is called from JClient below to illustrate this example. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <HTML> <HEAD> <TITLE>Test Applet Lookup Applet</Title> <CENTER><H1>Test Applet</H1></CENTER> </HEAD> <BODY> <APPLET CODE=Applet1.class WIDTH=760 HEIGHT=500></APPLET> </BODY> </HTML> /* Program Name: Applet.java Author: Steven J. Rulison Date: November, 18 2004 Purpose: Demonstrate a socket connection over the network. */ import java.applet.*; import java.net.*; public class Applet1 extends Applet { //Constructor public Applet1() { try { Socket s = new Socket("JServer", 1427); /* Flip Larsen suggested that I use the Applet.getCodeBase().getHost() method. I didn't have much luck with it. I think I need to see an actual example of how it's used. This is what I tried: Socket s = new Socket(Applet.getCodeBase().getHost(), 1427); I also tried printing to the command console and a null value returned. System.out.println(Applet.getCodeBase().getHost()); */ System.out.print("Socket connection successful."); } catch(Exception e) { e.printStackTrace(); System.out.print("Socket connection unsuccessful."); }//End of catch block. }//Constructor }//End of class Applet1. /* Class name: Server1 Author: Steven Rulison Date: November, 18 2004 Purpose: Demonstrate a socket connection over the network. This is the Server portion. */ import java.net.*; import java.io.*; public class Server1 extends Thread { public static void main(String[] Args) { try { ServerSocket ss = new ServerSocket(1427); Socket s = ss.accept(); }catch(IOException e) { e.printStackTrace(System.err); } }//End of main. }//End of class Server1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Applet console output when the applet is launched from from the Client: Java Plug-in 1.5.0 Using JRE version 1.5.0 Java HotSpot(TM) Client VM User home directory = E:\Documents and Settings\sruliso ---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging p: reload proxy configuration q: hide console r: reload policy configuration s: dump system and deployment properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level to <n> ---------------------------------------------------- java.security.AccessControlException: access denied (java.net.SocketPermission JServer resolve) at java.security.AccessControlContext.checkPermission(Unknown Source) at java.security.AccessController.checkPermission(Unknown Source) at java.lang.SecurityManager.checkPermission(Unknown Source) at java.lang.SecurityManager.checkConnect(Unknown Source) at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName0(Unknown Source) at java.net.InetAddress.getAllByName(Unknown Source) at java.net.InetAddress.getByName(Unknown Source) at java.net.InetSocketAddress.<init>(Unknown Source) at java.net.Socket.<init>(Unknown Source) at Applet1.<init>(Applet1.java:21) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at sun.applet.AppletPanel.createApplet(Unknown Source) at sun.plugin.AppletViewer.createApplet(Unknown Source) at sun.applet.AppletPanel.runLoader(Unknown Source) at sun.applet.AppletPanel.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Applet console output when the applet is launched from the server: Java(TM) Plug-in: Version 1.4.2_03 Using JRE version 1.4.2_03 Java HotSpot(TM) Client VM User home directory = C:\Documents and Settings\ADMINISTRATOR Proxy Configuration: Automatic Proxy Configuration URL: http://webt1resv.ilptab.il.us:8080/array.dll?Get.Routing.Script ---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this help message l: dump classloader list m: print memory usage o: trigger logging p: reload proxy configuration q: hide console r: reload policy configuration s: dump system properties t: dump thread list v: dump thread stack x: clear classloader cache 0-5: set trace level to <n> ---------------------------------------------------- == 2 of 3 == Date: Mon, Nov 22 2004 10:35 am From: Andrew Thompson <[EMAIL PROTECTED]> On 22 Nov 2004 09:48:23 -0800, S J Rulison wrote: > Applet Originate > > I'm not exactly sure what you mean when you say, "the applet is > attempting to communicate with the same server from which it > originated". That's what it basically comes down to, yes. > Lets say you have a java application file called Server1.class, a java > applet called Applet1.class, and an file html called TestApplet.html > all > stored in designated shared folder on the hard-drive of a PC running > Windows XP. The host name for this PC will be JServer. I don't have a host name of JServer, but 'localhost', so I changed your applet code slightly. Consider this variant of your 'Applet1'. <snippet> public class Applet1 extends Applet { public void init() { System.out.println("getCodeBase(): '" + getCodeBase() + "'" ); System.out.println("getCodeBase().getHost(): '" + getCodeBase().getHost() + "'" ); connect(getCodeBase().getHost()); } public static void connect(String host) { try { Socket s = new Socket(host, 1427); </snippet> I noticed below that how you commented that you tried the getCodeBase().getHost() method but "I didn't have much luck with it." That is the point at which you should be asking questions, which I answered quickly with the above lines and loading the HTML off the local hard disk, or by using the apache server. That code works when loading off the 'localhost', but throws the SecurityException when loaded from disk. (Check the output closely, when loaded off a network or hard disk) Applets can 'phone home' to the *host* that served them to the client, but they need to ne *signed* to communicate with any other server. That is what is tripping you up. > .. Assuming I am > correct with these assumptions, how would you go about getting > the Applet1.class to instantiate (originate) itself on the JServer > machine from the JClient PC? No, you are way off with this. Applets never run on the server. They may need to be signed to make a connection though. -- 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 == 3 of 3 == Date: Mon, Nov 22 2004 10:41 am From: Andrew Thompson <[EMAIL PROTECTED]> On Mon, 22 Nov 2004 18:35:24 GMT, Andrew Thompson wrote: > On 22 Nov 2004 09:48:23 -0800, S J Rulison wrote: >> .. Assuming I am >> correct with these assumptions, how would you go about getting >> the Applet1.class to instantiate (originate) itself on the JServer >> machine from the JClient PC? > > No, you are way off with this. Applets never run on the server. They are *delivered* from a server to a client, but always *execute* in the client. -- 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: How to starthandshake with client browser?? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2d41b9d8f6879f8b ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 10:12 am From: Rogan Dawes <[EMAIL PROTECTED]> Jakekeke wrote: > Thank Rogan again > (forget to do so) > > I have already finished by proxy on SSL part. > However my supervisor asked me to implement that part by another way. > ie, what i have done is same as your project before > every requests will open a new request and response socket > > now, what my supervisor wants is some request maybe do on same sockets pair > ie, maybe there have request ABC > after i send back the GET/POST response to request A > the thread in the while loop will send me the request B > it is no need to open another thread to make CONNECT again > > I have 2 source right now, > however, i dont know the 2nd method works or not, become it sometime does > is this the correct way to handle the SSL request?? Hi, I hadn't realised that this is homework. I hope that you are crediting any code ideas that you are getting. You need to make sure that the connection keep-alive works. Read RFC2616 to understand how this all is supposed to work. Search for "keep-alive" :-) Rogan -- Rogan Dawes *ALL* messages to [EMAIL PROTECTED] will be dropped, and added to my blacklist. Please respond to "nntp AT dawes DOT za DOT net" ========================================================================== TOPIC: Environment variable http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e10a85f420f52962 ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 10:22 am From: "Stefan Poehn" <[EMAIL PROTECTED]> "Michael Borgwardt" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Glynne wrote: > > I agree with this mostly, but OTOH it encourages stupid practices like > putting program configuration into environment variables. Can you give me a better place for path infos used by Java programs, batches, xsl scripts, build scripts and C++ programs? A "Windows only" solution is sufficient for my purpose. Thanks Stefan ========================================================================== TOPIC: How to do authentication and include the web page in the mail? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fa76bc88ec2794c3 ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 10:16 am From: Oscar kind <[EMAIL PROTECTED]> In comp.lang.java.help BB <[EMAIL PROTECTED]> wrote: > Below is my sendmail jsp (I copied it from somewhere else and it works for > me). It fetches the message from another page and sends it to a email. This is a good start, if you know what part of the code does what. > The > problem is that the smtp needs authentication. How do I add the > authentication detail in this jsp? And, how do I include the web page > instead of plain text in the email to be sent just like how it appears in > the email text area when I hit "Send page by email". The authentication needs to be added when you create the instance of SmtpClient, so read the API for that class. To include the web page instead of the plain text, you need to: - have the HTML in strParm - set the content type of the message to "text/html" (read the API of SmtpClient to see if and how this is possible). -- 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: CORBA or some other methodology? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a7b217bf697c503b ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 11:11 am From: ted holden <[EMAIL PROTECTED]> Bruno Grieder wrote: > I am not sure I understand your question: session management is a server > side issue more than anything else. Can your C++ app maintain a session? > > Please note that - officially - web services do not maintain sessions > state. Now, in Java, there are ways around this using the session context. > > b. With Corba, a client app instantiates a copy of an object, accesses methods of the object, possibly more than once, and then releases it. State can be maintained by the class data of the object. As I'm now hearing it, xmlrpc doesn't do that. The choice is between Corba, and figuring a way to make the app run without server-side state maintainance and I'll probably go with xmlrpc; it just requires a bit more thought in designing the app. Xmlrpc appears to be better adapted to distributed apps. Should need arise, there is also now a sort of an updated version of the same sort of thing as CORBA: http://www.zeroc.com/ice.html which might be useful for some future project, but not this one. Again, thanks! ========================================================================== TOPIC: request.getHeader - referer http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/810ddbb36c621b1f ========================================================================== == 1 of 2 == Date: Mon, Nov 22 2004 11:11 am From: Andrew Thompson <[EMAIL PROTECTED]> On 22 Nov 2004 11:00:41 -0800, Mark Fitz wrote: > request.getHeader("referer"); ... > I've tried all these ... Stop guessing. Find out what the headers are, using.. HttpServletRequest.getHeaderNames() -- 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 == 2 of 2 == Date: Mon, Nov 22 2004 12:07 pm From: "sks" <[EMAIL PROTECTED]> "Mark Fitz" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > I am having some basic problems with > request.getHeader("referer"); > > It produces a null every time I try to link to my page. > > I've tried all these > request.getHeader("referer"); > request.getHeader("Referer"); > request.getHeader("REFERER"); Well it's referer lower case. But it only works if you've clicked a link. If you type something in at the url bar the referer will always be null. ========================================================================== TOPIC: Percent JFormattedField http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/46a6264dce518fae ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 11:38 am From: Andrew Thompson <[EMAIL PROTECTED]> On 22 Nov 2004 11:19:27 -0800, Dmitri wrote: I'm not so experienced with JFormattedTextField to solve your problem, though I played with your code out of interest. > See sample code below. You can actually compile and run it > to see the problem. Good example! Except for one (late I assume) typo. > <sample_code> .... > for (int i = buffer.length() - 1; i >= 0; i--) { > char ch = buffer.charAt(i); > if (!Character.isDigit(ch) && ch != '-') > buffer.deleteCharAt(i); > } > super.insertString(fb, offset, buffer.toStri343ng(), attr); .... Where did the '343' come from? BTW - Please do not x-post so widely, I recommend you set the Follow-Ups to c.l.j.gui *only* (as I have done). The people that can answer this are on c.l.j.gui, if anywhere. -- 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: tomcat css mime-type http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4f0bba1ea74e6ae5 ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 11:35 am From: kaeli <[EMAIL PROTECTED]> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] enlightened us with... > Hello, > > I'm using Tomcat 3.3.2 with Apache 1.3.26 . > I can't set proper mime-type for my "css" files, though I have this section in > my /WEB-INF/web.xml: I know Tomcat looks at that. I don't know if Apache does. My guess - Apache isn't, yet is the one serving the doc. Did you set the mime type in Apache? -- -- ~kaeli~ Doing my part to piss off the Religious Right. http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace ========================================================================== TOPIC: Color. http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9cc5c64bd649be2b ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 11:50 am From: "Ann" <[EMAIL PROTECTED]> "Andrew Thompson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sun, 21 Nov 2004 15:33:44 -0700, Chris Smith wrote: > > > John Bailo <[EMAIL PROTECTED]> wrote: > .. > >> Color.WHITE; > >> > >> and > >> > >> Color.white; > .... > > None. The all-caps version (WHITE) was added in a later Java version .. > > 1.4, whereas 'white' was in 1.1. I have been caught out by that > several times, so in 'protest' I tend to use.. > > new Color(255,255,255) > I like new Color(1.0f, 1.0f, 0.0f); ========================================================================== TOPIC: Question regarding marker interfaces.... http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cf059e2fa32de473 ========================================================================== == 1 of 2 == Date: Mon, Nov 22 2004 11:26 am From: [EMAIL PROTECTED] (pentium) Hi folks, I was just wondering why does Java need empty interfaces like serializable & cloneable if they don't specify any methods ? What purpose do they serve then ? Any pointers would be appreciated. Thanks, -MK. == 2 of 2 == Date: Mon, Nov 22 2004 12:06 pm From: Collin VanDyck <[EMAIL PROTECTED]> pentium wrote: > Hi folks, > I was just wondering why does Java need empty interfaces like > serializable & cloneable if they don't specify any methods ? What > purpose do they serve then ? > Any pointers would be appreciated. > > Thanks, > -MK. Once use for these interfaces is in the Avalon component framework, in which you write lots of little components, and then the underlying framework dictates how those components get used in the course of your program execution. One of their marker interfaces has to do with thread safeness. For example, you can implement the marker interfaces "SingleThreaded", or "ThreadAware" (I might have gotten these interface names wrong). The implementation of these classes tells the underlying framework how to pool instances of your components. For example, if you have "ThreadSafe" implemented, it will only keep one instance of your component around because it is thread-safe and all calling methods can access your component safely. However, for "SingleThreaded" components, the underlying framework then has to keep a pool of your objects around and issue them to calling threads, growing the pool as necessary. It's handy when you want to find out information about an object, but is wasteful when you have to instantiate an object/component and invoke an instance method on it. With the marker interfaces you can simply query the class structure to determine how to handle that particular class. ========================================================================== TOPIC: SimpleQ - A simple Message Queue Implementation http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4dc30965c39863ae ========================================================================== == 1 of 1 == Date: Mon, Nov 22 2004 11:29 am From: [EMAIL PROTECTED] (Frank Gerlach) SimpleQ is a very simple Message Queue Implementation. It doesn't have the multitude of features like MQSeries or other commercial systems. The design goal of SimpleQ is to provide a robust and simple system at no cost. Robustness is easier to achieve if a system is simple; lots of features just imply lots of bugs. More: http://www.geocities.com/gerlachfrank/SimpleQ.html ======================================================================= 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
