comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * how to get application path? Is that my method in getting path wrong? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c39434502d515e0d * MIDP MIDlet: which characters are supported in the phone font? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/73bdfdf7f36c6ea0 * Is there any java method which do the following function? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f355c57a8ec1978b * Help using String.split(..) - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fca5e4b22d736835 * ActiveX Container in Java - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/188085b06e48f3d1 * Where to place configuration files when using WAR-Files - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/74dc1db3e419defd * jsp web application development - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f2b936f5b357d080 * Threads and modal dialog behaviour question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a5f146a46cb92ad * Redirecting web service calls in Apache AXIS -> mediator / proxy - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dc514447e04effe9 * Obfuscation of 3rd art jars and distribution legal issues - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/db0dc7b834250179 * JSP creating problems with japanese characters - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6ae5d940513fc0ec * How to restrict direct access to JSP files, only allow access via servlet? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/514c912d89045a82 * Java double precision - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ffd916b2ccb1a75b * URL and FileNotFoundException - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c1d75866a1a811a6 * Thread and Listener - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79e41b9865d2cf15 * Java2D Direct3D usage disabled by J2D_D3D env - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1436e957128d44c3 * Tomcat 5, EL Expressions in jsp:inlcude - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4da7307e1d9d37b9 * Sockets - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/edecab678cd31cd6 * "static" prefix - to parallel "this" prefix - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157 * How to initialize a big (String-)Array fast? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a849e4e56de0eae ============================================================================== TOPIC: how to get application path? Is that my method in getting path wrong? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c39434502d515e0d ============================================================================== == 1 of 2 == Date: Tues, Dec 7 2004 3:25 am From: [EMAIL PROTECTED] James wrote: > eg. > c:\myapp\test.class > c:\myapp\icon\icon1.gif > c:\myapp\setting.cfg > > when I compile and run test.class > in coding, I write > something.setImageIcon(getClass().getResource("/icon1.gif")); > after process something, the program will save the file setting in > setting.cfg > something.savefile(new > File(getClass().getResource("/setting.cfg").toString())); > > all of this run ok, the image got load up, then when save setting, it got > write back into setting.cfg file. > > Later I group all of this in 1 jar file. > then when I try the program, it cannot run anymore. something related to > nullpointerexception. Any specific 'something', or are you inviting us to guess what your actual error was? > I try to get out the path and I found out that when running in normal > class(without jar), that code can get correct path and the file. > but when run in jar(with main class) that code can't get correct path. > It got something at between the parent path and class path. > at center it come out something like jar file(it act like 1 level path) Examples? > so I want to ask you all, normally how do you all get the running path > correctly so that can load the image and save file back to running class's > path When working with getResource() you aren't really working with regular files on a disk, like you would with a java.io.File object, but data which acts as resources to classes. Physically these can be stored in many ways - just as class files themselves can be stored in many ways: as files on the file system, as entries in a Jar, even as records in a database - so long as there is a classloader which knowns how to fetch them from a given identifier String. If you want to read and write to a local disk, use java.io.File and an appropriate chain of Input/Output and Reader/Writer streams. Don't use getResource() , as when your representation changes (like you go from packages mapped out on the local disk, to packed in a Jar file) then things are likely to break. -FISH- ><> == 2 of 2 == Date: Tues, Dec 7 2004 11:59 am From: Andrew Thompson On Tue, 7 Dec 2004 17:39:26 +0800, James wrote: > eg. > c:\myapp\test.class is 'test.class' in 'myapp' package, or is it in the default package? > c:\myapp\icon\icon1.gif > c:\myapp\setting.cfg > > when I compile and run test.class > in coding, I write > something.setImageIcon(getClass().getResource("/icon1.gif")); If 'default'. The path to the icon is.. URL url = getClass().getResource("/icon/icon1.gif"); // now TEST the URL! System.out.println( "icon1 URL: " + url ); something.setImageIcon( url ); > after process something, the program will save the file setting in > setting.cfg > something.savefile(new > File(getClass().getResource("/setting.cfg").toString())); You cannot save the data back into the class jar, and it it best *not* to write it in the progtam path but the user's 'user.home' directory.. <http://www.physci.org/codes/javafaq.jsp#path> > all of this run ok, the image got load up, then when save setting, it got > write back into setting.cfg file. > > Later I group all of this in 1 jar file. > then when I try the program, it cannot run anymore. something related to > nullpointerexception. To expand on what FISH wrote.. <http://www.physci.org/codes/javafaq.jsp#exact> -- 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: MIDP MIDlet: which characters are supported in the phone font? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/73bdfdf7f36c6ea0 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 3:42 am From: [EMAIL PROTECTED] (Jens) Which unicode characters does a phone support? Is this defined somewhere? Does a phone support pi and math symbols and arrows? Jens Martin Schlatter ============================================================================== TOPIC: Is there any java method which do the following function? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f355c57a8ec1978b ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 12:47 pm From: Thomas Kellerer On 07.12.2004 10:31 Michael Borgwardt wrote: > mikeotp wrote: > >> regards: >> >> Is there any java method which do the following function? >> >> file1-------------------->file2 >> The method's handle > > > What is it supposed to *do*?? > I think after the user inputs the literals "file1" and "file2" it should display two labels on the screen which are connected with an arrow. Thomas ============================================================================== TOPIC: Help using String.split(..) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/fca5e4b22d736835 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 11:46 am From: Andrew Thompson On Tue, 7 Dec 2004 00:20:49 -0700, Chris Smith wrote: > Andrew Thompson <[EMAIL PROTECTED]> wrote: >> Just out of curiosity, you judge this as 'irritable'? >> >> "Hi. Could you post questions of this nature to comp.lang.java.help * >> rather than c.l.j.programmer in future?" > > No, I read the web page you linked to; the one where you said "Short > sharp rebukes will be in store for any who dare post a lazy, ill-thought > out, badly researched or otherwise stupid question to c.l.j.programmer". > If that's true, it's a sad statement about the group. On reflection. You're right, it needs adjusting. How about.. "Short sharp rebukes *may* be in store for any who dare post a lazy, ill-thought out, badly researched or otherwise stupid question to c.l.j.programmer". [ And note that my response to the OP in this instance was neither sharp, nor a rebuke. ] -- 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: ActiveX Container in Java http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/188085b06e48f3d1 ============================================================================== == 1 of 2 == Date: Tues, Dec 7 2004 3:51 am From: [EMAIL PROTECTED] Dan wrote: [snipped...] > To be honest I dont know a lot about ActiveX, are you saying that > ActiveX is a windows only technology? (i know this has nothing to do > with this newsgroup, but it does follow on in this thread) So do you > know what happens with Microsoft Work for Mac? I know microsoft have got > Word for Mac, but does that mean that the mac version isnt and ActiveX > control at all? Any ideas how I would do the same thing on a mac? Im > trying to embed Word within my Java Application. Alternatively if I > could find a class that allows viewing of a word document that would be > sufficient for my needs. Can anyone help me with this? I'm no ActiveX expert either, but what I do know (I think!) is that ActiveX components are native code, so they cannot be moved from one platform to another. As to whether the iMac has ActiveX, I can't say. I'm not aware of any Mac implementation, although strictly speaking there's nothing to stop Microsoft creating an iMac version of ActiveX (in the same way that they create Mac versions of Internet Explorer) but that doesn't mean that components are interchangable between Mac and PC. Either way you are going to end up shipping platform specific binaries as part of your app, to enable Java to interface with the native ActiveX implementation in the given environment (assuming that isn't just Windows.) A quick Google reveals: http://jakarta.apache.org/poi/ -FISH- ><> == 2 of 2 == Date: Tues, Dec 7 2004 3:51 am From: [EMAIL PROTECTED] Dan wrote: [snipped...] > To be honest I dont know a lot about ActiveX, are you saying that > ActiveX is a windows only technology? (i know this has nothing to do > with this newsgroup, but it does follow on in this thread) So do you > know what happens with Microsoft Work for Mac? I know microsoft have got > Word for Mac, but does that mean that the mac version isnt and ActiveX > control at all? Any ideas how I would do the same thing on a mac? Im > trying to embed Word within my Java Application. Alternatively if I > could find a class that allows viewing of a word document that would be > sufficient for my needs. Can anyone help me with this? I'm no ActiveX expert either, but what I do know (I think!) is that ActiveX components are native code, so they cannot be moved from one platform to another. As to whether the iMac has ActiveX, I can't say. I'm not aware of any Mac implementation, although strictly speaking there's nothing to stop Microsoft creating an iMac version of ActiveX (in the same way that they create Mac versions of Internet Explorer) but that doesn't mean that components are interchangable between Mac and PC. Either way you are going to end up shipping platform specific binaries as part of your app, to enable Java to interface with the native ActiveX implementation in the given environment (assuming that isn't just Windows.) A quick Google reveals: http://jakarta.apache.org/poi/ -FISH- ><> ============================================================================== TOPIC: Where to place configuration files when using WAR-Files http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/74dc1db3e419defd ============================================================================== == 1 of 2 == Date: Tues, Dec 7 2004 3:55 am From: [EMAIL PROTECTED] Stephan Koser wrote: > Hi, > > we'd like to provide our web application as a WAR-File. Up to now we have > our configuration files inside the WEB-INF directory. > But we don't want to force our clients to unpack, edit and pack the war file > if they want to configure the application. Instead we want to provide a > configuration dialog at the first call of our application. > But the question is: Where to place the configuration? > > We don't want to put it in the WAR file. So, are there any standards in J2EE > where to place configuration files, that may change during runtime? > Any hints? Your question is highly container dependent. What container are you using? == 2 of 2 == Date: Tues, Dec 7 2004 1:22 pm From: "Stephan Koser" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > > Stephan Koser wrote: > > Hi, > > > > we'd like to provide our web application as a WAR-File. Up to now we > have > > our configuration files inside the WEB-INF directory. > > But we don't want to force our clients to unpack, edit and pack the > war file > > if they want to configure the application. Instead we want to provide > a > > configuration dialog at the first call of our application. > > But the question is: Where to place the configuration? > > > > We don't want to put it in the WAR file. So, are there any standards > in J2EE > > where to place configuration files, that may change during runtime? > > Any hints? > > Your question is highly container dependent. What container are you > using? Well, we try to support as many App-Servers as possible. Up to now: Tomcat, OC4J, Oracle IAS, IBM WebSphere, Bea WebLogic and some others that are not well known. The solution should work with as many as possible. -- bye Stephan... ============================================================================== TOPIC: jsp web application development http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f2b936f5b357d080 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 12:06 pm From: "claydn" Hi, I originally submitted this to another group but think this one is more appropriate so was wondering if anyone could help. Thanks Nick --------------- I am new to JSP development and I need to create a web application with a database back end (MS Access for test purposes). I have found some code which connects to the database, and displays the records but all the code is done on one jsp page. I would like to take it a bit further and remove this from the jsp page. So I have a Connect function, a Disconnect function and a RunQuery function, which I can call from the jsp page. But what is the best way to do this? Would it be in a Bean ? Does anyone have an sample code I could look at which shows simply how to connect to the database this way and run a query against it ? Thanks Nick ============================================================================== TOPIC: Threads and modal dialog behaviour question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a5f146a46cb92ad ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 1:06 pm From: Aloys Oberthür I have a question on modal dialogs in (non-event-dispatching)Threads. I do set a flag in the actionPerformed() method of a modal dialog and the object which displayed the dialog in the first place can question this flag after "returning" from show(). I would have expected this to be not timing dependant, but I see it is not which I do not understand that's the dialog in essence: class ModalerDialog extends JDialog implements ActionListener { boolean flagSuccessful = false; ... public void actionPerformed(ActionEvent aE) { String cmd = aEvt.getActionCommand(); if(cmd.equals("one")) { flagSuccessful = true; this.setVisible(false); } else if(cmd.equals("two")) { flagSuccessful = false; this.setVisible(false); } } public boolean isSuccessful() { return flagSuccessful; } } and that is the Thread launched within the actionPerformed()-method of a menu ActionListener (see // comments) Thread t = new Thread() { public void run() { ModalerDialog md = new ModalerDialog(owner, true); md.show(); boolean b = md.isSuccessful(); // now on "one" false try { Thread.sleep(250); } catch (InterruptedException e1) {} b = = md.isSuccessful(); // and now on "one" true ???? if(md.isSuccessful()) md.dispose(); else { md.dispose(); owner.showStartupDialog(); } } }; t.start(); Who eplain that to me? Thanks, Aloys ============================================================================== TOPIC: Redirecting web service calls in Apache AXIS -> mediator / proxy http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dc514447e04effe9 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 1:19 pm From: Michael Spahn Hi experts, I'm using Apache AXIS as web service server and want to extend AXIS to be able to do the following: If AXIS receives a call to a web service a decision has to be made wheter the web service is called locally or if it gets routed to another endpoint URL. After routing the call AXIS has to wait for an anwswer and redirect the answer to the client. The client should not notice that its call to the web service has been routed to another server. So in this case AXIS should act like a proxy or a mediator for web service calls. The aim is to have one instance for calling web services, but the decision where the web service is really called is made dynamically (for exaple at the server with the best quality of service properties at the time of calling). I would be glad if someone could give me some hints on how to do this. Especially I'm interested in where and how to do the redirect. (It's absolutely sufficient to handle only synchronous calls via http transport.) Can all this be done in an individual AXIS handler? Has somebody experience in building mediators for web services in java and can give me some hints? What's the best way to do this? Thanks in advance, Michael ============================================================================== TOPIC: Obfuscation of 3rd art jars and distribution legal issues http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/db0dc7b834250179 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 4:18 am From: [EMAIL PROTECTED] Hi, I am thinking of using a 3rd party jar for a personal project - I am curious, given that I will pay for this library I will need to distribute it with my aplication for my app to run. Whats to stop someone downloading my application and just stealing the 3rd party jar? Also, I dont think the class files in the 3rd party jar are obfuscated, what are the legal implications of obfuscating someone elses commercial jar? I am guessing its all going to be down to the individual license agreements but are there any general guidelines or websites with info on these legal matters? I am particularly keen to know how one is expected to distribute an application which includes a 3rd party jar the developer payed for! thanks guys! ============================================================================== TOPIC: JSP creating problems with japanese characters http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6ae5d940513fc0ec ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 4:35 am From: [EMAIL PROTECTED] (dinesh) I have given unicode support to my application by using struts framework. But when i put some japanese value into the text box and if i display that value on tomcat then result is distorted characters. If i again print those values on jsp then also it is wrong I am using struts framework but if i put the value in textbox and submit the form then if at some condition jsp comes back then the same japanese character is distorted All the jsps are UTF-8 compliant. Thanx Rgds ============================================================================== TOPIC: How to restrict direct access to JSP files, only allow access via servlet? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/514c912d89045a82 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 6:41 am From: "Ryan Stewart" "Anan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How to restrict direct access to JSP files, but allow access only via > servlet? > Is it possible via .htaccess? If so, e.g. of a snippet on how to do > it? Any other ways? Thanks. Put all JSPs in WEB-INF. ============================================================================== TOPIC: Java double precision http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/ffd916b2ccb1a75b ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 1:11 pm From: wald Michael Borgwardt <[EMAIL PROTECTED]> wrote: > http://mindprod.com/jgloss/floatingpoint.html Another good explanation of what's happening under the hood is this one: http://en.wikipedia.org/wiki/Computer_numbering_formats Wald ============================================================================== TOPIC: URL and FileNotFoundException http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/c1d75866a1a811a6 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 7:10 am From: "Ryan Stewart" I haven't worked much with URLs and such. The following code works almost as desired. The only problem is that if "blah.jsp" doesn't exist on http://localhost:<port>/, it throws a FileNotFoundException. If I request an existing resource, it returns the resource just fine (though I somewhat expected to get the HTTP headers as well). For a non-existing resource, I was looking for it to return the HTML of the server's 404 page. Essentially, I want this program to act as a mini-browser and always return the server's response, not throw exceptions like this. Should I just make a straight Socket connection to the server and read back the full response manually? import java.io.*; import java.net.*; public class URLTester { public static final int TEST_PORT = 8080; private int port; public URLTester(int port) { this.port = port; } public void work() throws MalformedURLException, IOException { URL url = new URL("http://localhost:" + port + "/blah.jsp"); System.out.println("** Requesting " + url); InputStream in = url.openStream(); int data; while ((data = in.read()) != -1) { System.out.print((char) data); } in.close(); } public static void main(String[] args) { URLTester tester = new URLTester(TEST_PORT); try { tester.work(); } catch (MalformedURLException mue) { mue.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } } } ============================================================================== TOPIC: Thread and Listener http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/79e41b9865d2cf15 ============================================================================== == 1 of 2 == Date: Tues, Dec 7 2004 5:23 am From: "Bob Rivers" Hi, I'm doing some experiences with JOESNMP. It's very good. Guided by the examples I was able to build a listener that receives snmp traps. It's working fine (when running through console). So I decided to start it automatically, together with my web application (that is running under tomcat). I have a servlet that is executed when tomcat starts (using <load-on-startup>). So I did a call to my new class. The problem is that this class is actually a listener. When it starts, it hangs the other procedures, including tomcat initilization. I tryed to put it under a thread, but it also hangs as soon it starts to listen for snmp traps. How do I ran a listner without blocking other processes? I am looking for a solution that should work both on linux and windows. I don't know if I made myself understood. Sorry my poor english. TIA, Bob == 2 of 2 == Date: Tues, Dec 7 2004 5:22 am From: "Bob Rivers" Hi, I'm doing some experiences with JOESNMP. It's very good. Guided by the examples I was able to build a listener that receives snmp traps. It's working fine (when running through console). So I decided to start it automatically, together with my web application (that is running under tomcat). I have a servlet that is executed when tomcat starts (using <load-on-startup>). So I did a call to my new class. The problem is that this class is actually a listener. When it starts, it hangs the other procedures, including tomcat initilization. I tryed to put it under a thread, but it also hangs as soon it starts to listen for snmp traps. How do I ran a listner without blocking other processes? I am looking for a solution that should work both on linux and windows. I don't know if I made myself understood. Sorry my poor english. TIA, Bob ============================================================================== TOPIC: Java2D Direct3D usage disabled by J2D_D3D env http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1436e957128d44c3 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 8:42 am From: "Brij" Hi, I get this message on my console (at the end) everytime I run a piece of code. The message is "Java2D Direct3D usage disabled by J2D_D3D env". What is this ? I read the file: jdk1.4\demo\jfc\Java2D\README.txt which says I should [Run with following parameter: -Dsun.java2d.noddraw=true] This is the information in the README file. ----------------------------------------------------------------------- Known Issue ----------------------------------------------------------------------- This problem is present on Microsoft Windows 95 with DirectX and Windows 98 and 98SE operating systems. Solaris(TM) and Windows NT operating systems are not affected. Java2Demo exhibits random lockups in lengthy looping runs or in runs having "custom Thread" activated specific tabs such as Transform. This lockup occurs mostly on slower machines, PII233 and below, but is also seen less frequently on faster machines. The cause is possibly DirectDraw and/or videocard driver or combination thereof. Please do one of the following to either prevent or reduce the chances of a lockup: Run with following parameter: -Dsun.java2d.noddraw=true java -Dsun.java2d.noddraw=true -jar Java2Demo.jar and/or visit Microsoft's DirectX and dnload the latest as well as the latest of your videocard driver. ====================================================================== BUT when I tried running with the above parameter, I got the following ERROR: Exception in thread "main" java.util.zip.ZipException: The system cannot find the file specified at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:112) at java.util.jar.JarFile.<init>(JarFile.java:127) at java.util.jar.JarFile.<init>(JarFile.java:65) Could you please tell me how to stop getting this message "Java2D Direct3D usage disabled by J2D_D3D env" everytime on the console. I use JBuilderX for development and the OS is windows XP professional and the jdk is jdk1.4.2. ============================================================================== TOPIC: Tomcat 5, EL Expressions in jsp:inlcude http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4da7307e1d9d37b9 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 7:55 am From: Mark F The Abrasive Sponge wrote: > MF wrote: > >> >>> It's a JSF issue. >>> >>> http://java.sun.com/j2ee/javaserverfaces/faq.html#includes >>> >>> >>> Looks like you will have to do >>> <f:subview><jsp:include /></f:subview> >>> Please let me know what you find out! >>> >> Nope, I'm already using <f:subview> tags. I still get HTML with >> unevaluated expressions. > > > You got me interested in using jspx. I did the following with something > like this. I get some errors with my xhtml right now, but this may be > something to consider. > > P.S. I am using jstl, which may be more useful because the import tag > recognized the context path :) > > > <f:subview id="form_subview"><c:import url="form_1.jspf"/></f:subview> I've concluded that XML only JSPs with JSF isn't really supported right now. Not in a practical way. I guess I'll be forced to go back to non-XML JSPs. I guess I can live with that though I really wanted it to work. -Mark ============================================================================== TOPIC: Sockets http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/edecab678cd31cd6 ============================================================================== == 1 of 2 == Date: Tues, Dec 7 2004 2:20 pm From: "FunkyKarma" "Michael Borgwardt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > FunkyKarma wrote: > > >> But what will be the *content* of the communication? > >>C programmers tend to want to just send structs, which is not portable. > > > > > > The content doesn't matter. > > Yes, it does. Otherwise, there is no communication. Idiotic response - arguing for arguing sake. > > > Sending a struct is not a problem. > > Yes, it is. > > > On the > > receiving end you just have to know what bytes were written onto the wire. > > And you DON'T KNOW that with a struct! Because it uses compiler- and platform > dependant padding, endianness and data type sizes. > You can know all the stuff that you are referring to above. I'm not saying it's a good idea to do something like writeToSocket (&someStruct, sizeof (someStruct)) ... I'm just saying it's possible. == 2 of 2 == Date: Tues, Dec 7 2004 6:26 am From: "FunkyKarma" > > For example java.net.Socket doesn't implement out-of-band communication (at > > least not the last time I checked). If your C/C++ app uses that socket > > feature then you are screwed - unless you can find and use another Java > > socket wrapper than what comes with the JDK. > > So, you assume that you have to know what language uses yahoo.com to read their > web site? Pretty funny! Socket connection is socket connection, doesn't matter > how much power you have about it. You know, in assmbler you are even more > powerful and can do whatever you want! > Here's an example... The Informix DBMS uses the out-of-band channel for client initiated cancel of queries. The java.net.Socket class does not support out-of-band, so you can't do a cancel from Java with java.net.Socket. So it matter what socket implementation you are using. Not the language per se. > > > > The content doesn't matter. Sending a struct is not a problem. On the > > receiving end you just have to know what bytes were written onto the wire. > > It doesn't matter at all if those bytes where part of a struct data > > structure on the sending side. The "struct" doesn't get sent, but the bytes > > that make up the struct does. > > So, you don't know about big/little endian and all other not important stuff > like LF/CR or float mantissa or even bytes 7 bits long? > Mainframe or Apple or other systems which you don't know can have a little rest > today. Already well followed up by another poster in this thread. ============================================================================== TOPIC: "static" prefix - to parallel "this" prefix http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157 ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 2:15 pm From: Tim Tyler Darryl L. Pierce <[EMAIL PROTECTED]> wrote or quoted: > Tim Tyler wrote: > > I already indicated the problems with using the class name: > > > > ``The rationale is that using the class name all over the place > > hinders refactoring and code readability, and violates the > > prinicple of specifying each fact in one place.'' > > > > If the class name is a rather LongOneWithManyCharacters the approach > > becomes unweildy. > > How does it hinder refactoring? Search-and-replace the old class name > for the new class name in one source file and it's done. Not a problem. That step is totally unnecessary if the class neme is not hird-wired into the class all over the place. Also - as I mentioned - using the name in many places in the class hinders readability if the class name is very long. > And, what do you mean by "specifying each fact in one place"? Sorry, I'm > not familiar with that phrase with regards to software development. Useful programming proverb: specify each fact in one place. More realistic verion: specify each fact in as few places as possible. > What fact is being specified all over the place that wouldn't also be > specified all over the place by the "static" keyword? The name of the class. -- __________ |im |yler http://timtyler.org/ [EMAIL PROTECTED] Remove lock to reply. ============================================================================== TOPIC: How to initialize a big (String-)Array fast? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a849e4e56de0eae ============================================================================== == 1 of 1 == Date: Tues, Dec 7 2004 6:28 am From: "John C. Bollinger" Tim wrote: > Doesn't Java run on some 64-bit processors? Yes. > I too was surprised 1.5 did > not integrate 64-bit addressing. OS's incorporated this in the mid-90's > so Java not having it is questionable. Java is not concerned with addressing at all. Not 64-bit addressing, not 32-bit addressing, not 24-bit addressing. Not 3417-bit addressing. It is designed to be platform independent, so I don't expect it ever to be concerned with such details. > As always, when the processor > cannot access available RAM then the "OS magic" for accessing secondary > memory (disk, swap, pagefile) comes to bear. In this case, create a > class that implements Collection but serves Strings. Back it with File > or RandomAccessFile. You can even amortize the initialization by > initializing on access and make it "faster" in total time used because > you will not allocate Strings unless they are used. What you describe is not "OS magic", with which I was specifically referring to some (nonexistent) means for a processor to address more memory than its address space permits. The array presented by the OP could not have been effectively used in any JVM I am aware of on a Pentium 3 (processor specified by the OP) even if the OS applied all available _virtual_ memory to the problem, regardless of the amount of RAM, swap space, and disk available to the system. It is conceivable that a VM might back an array with secondary storage as you describe, but no VM I am aware of does so, probably because the implementation would greatly complicate an otherwise relatively simple language feature, and because the resulting performance would fall far short of user expectations. Yes, the OP could use a disk-backed Collection. Depending on his needs that might be an appropriate solution (though I doubt it), but that's rather a different thing from an array, and not what he asked about. > Of course, the simple fix is to allocate an array of array of Strings > and make accessors. No, that's not a fix at all. The point is that the memory consumed by the Strings themselves (if all distinct) would be in excess of the amount of memory addressable by the processor in question. > John, about 64MB memory-mapped blocks, I guess this is like on a 64MB > RAM machines? No, this is a kernel-level issue. OS kernels can, and at least some do, place limits on the size of a memory-mapped block. 64MB is a limit that at at least one time was reasonably common. That does not prevent mapping several segments of the same file, and if you're careful you may even be able to map them to contiguous addresses, but its an added complication of relying on memory mapping files. The amount of RAM in the system is not relevant at all. > For this RandomAccessFile, at least with 1.4.1_05, barfs > if you try to access more than the given amount of RAM. TIJ refers to > this limit correctly as length(). > http://www.eastons.org/tij/TIJ314.htm#Index1408. I'm not sure what I was supposed to find at that URL, but it says nothing relevant about the length() of a RandomAccessFile. My reference for Java platform APIs is generally the API docs. In any case, RandomAccessFile has almost nothing to do with RAM -- it is an interface to a file on some filesystem accessible to the VM. The filesystem, OS, and disk hardware will place limits on the maximum size of such a file. The length() is the current length of the file, which is the limit for reading but not for seeking or writing (by which the length can be extended). > This memory is not > GC'ed either AFAICT! The contents of the file are not memory in the sense that Java uses the term. The file may exist prior to execution of a Java program that accesses it, and it is reasonable to suppose that it might be desirable for the file to persist after the program completes. Of course the *file* is not GC'd. The associated RandomAccessFile *object*, on the other hand, is subject to GC just like any other object. > Anybody know if the filename given can be used by > other code (non-Java) to access the same RAM? *It is not RAM.* Since it is a file on the filesystem, yes, other programs may access it before, during, and after your Java program's use of it. HOWEVER, you cannot safely assume that writes to the file (from Java or otherwise) are immediately committed to disk, so multiple programs simultaneously accessing the file may not have consistent views of its contents. John Bollinger [EMAIL PROTECTED] ============================================================================== 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
