comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * cancel <[EMAIL PROTECTED]> - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a3f061c259c61b3b * UTF of Java strings? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/affc243ccd92519f * Are conventions for file structures needed in java? - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b40d0c961b99c261 * Why can't I get Tomcat to hot deploy? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/61cdbd0946791b2e * Concurrent Logging: How? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1e88399af98f57e5 * looking for example of problems when accessing GUI items in non event dispatch thread - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6eb292f53e7433ca * JSP: error page exception.getMessage returning null for setProperty exceptions - 5 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/570e60d4493f982d * gui hangs in join() - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/60cecb273fbb5b9b * Admin Console for Tomcat 5 - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1948f031e265b95 * Literature on boolean naming/usage conventions? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dabf0085d6427c15 * Accessing network drives from 1.4.2 (windows box) - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f152296603006240 * Moving from Eclipse to WebSphere Application Developer (WSAD) - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2e6c8a871275f6b8 * problem with weblogic 5.1 an new jar files - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4ec8d0c04d0ec9ef * ASP.NET Mobile control competitor in Java - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/38eb7f312d7830c4 * The most efficient way to innitialize an array with an innitialization list - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/99c3070fafe45d04 * Weird JVM Behaviour? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2c29874b2eb19265 * rmic stub generation - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b491ad1fa6d05dd0 * How to put XSLT element <xsl:value-of> inside an HTML tag? - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/184eebeab42880ea * How to make a whitespace in XSL? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cf1e91b8d5326e8a * how to test an empty element in XSL? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/88329b6f5dc0f3a1 * Put a comma with conditions in XSL - 3 messages, 3 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/883705942bf1c1e7 * Division by zero: float vs. int - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6dc583f6638fa877 ========================================================================== TOPIC: cancel <[EMAIL PROTECTED]> http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a3f061c259c61b3b ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 7:09 am From: [EMAIL PROTECTED] This message was cancelled from within Mozilla. ========================================================================== TOPIC: UTF of Java strings? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/affc243ccd92519f ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 11:20 am From: "Mike Schilling" <[EMAIL PROTECTED]> "bugbear" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mike Schilling wrote: >> If the size of char were undefined, and char was not convertible to any >> integer type... > > Doesn't that make encryption (e.g. rot13 ;-) rather harder to implement? > More cumbersome, anyway: you'd need to convert the chars to bytes (say, using UTF8 or UTF16) and encrypt the bytes. ========================================================================== TOPIC: Are conventions for file structures needed in java? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b40d0c961b99c261 ========================================================================== == 1 of 3 == Date: Mon, Oct 11 2004 11:28 am From: The Abrasive Sponge <[EMAIL PROTECTED]> Ok I have been doing java for a while. But I am thinking I may have unfortunately started off the wrong way. Maybe. Outerlying file structures have no convention. Seems that the open source community is the driving force to one convention that seems to be the norm. I would like to know if there is a website that talks about the conventions normally used. If not I believe one needs to be developed. Currently the way I do it. I have a development folder, and in this development folder I have my customers. Within the customers I have the projects that I am doing for them. For example: <Root> |- development | |- customerA | |- customerB | |-webAppA | | |-build | | |-build.xml | | |-data | | |-Pojo.java | | |-servlets | | |-listeners | | |-dao or entity | | |-actions | |-jnlpAppB | | |-sales | | |View.java | | |Model.java | | |Controller.java This is a kind of a sample of what I do, and my organization. Of course, my classpath would contain <Root>/development/customerB/webAppA/data, <Root>/development/customerB/webAppA/servlets, etc. I use packages extensively but in the above example I omitted them in the diagram for clarity. As you see my packaging is not really consistent. Now I am thinking I am doing this the wrong way. I am wanting to do commit to a standard. Would any of these be a correct convention (below) of organizing file structures or do you have better ideas for this? <Root> |- development | |- customerA | |- customerB | |-webAppA | | |-build <- would a build file go here? | | | or just the resulting deliverable? | | |-src <- source files only? | | |-actions <--technology driven | | |-servlets | | |-listeners | | |-lib <- libraries other jars needed etc? | | <Root> |- development | |- customerA | |- customerB | |-webAppA | | |-build <- would a build file go here? | | | or just the resulting deliverable? | | |-src <- source files only? | | |-sales <---use case driven | | |-manager | | |-customer | | |-lib <- libraries other jars needed etc? | | The next question is how do I organize the source file packages? For example, say I am making a web app. Do you package like this? com/mycorp/sales/servlet/Something.java where the use case is before the technology or vice versa com/mycorp/servlet/sales/Something.java? I guess I am asking is what is the convention for package naming in any environment is it technology driven or use case driven? Do you have your own methods of packaging? Let me absorb your thoughts. :) == 2 of 3 == Date: Mon, Oct 11 2004 1:31 pm From: Bryce <[EMAIL PROTECTED]> On Mon, 11 Oct 2004 12:28:40 -0600, The Abrasive Sponge <[EMAIL PROTECTED]> wrote: >Ok I have been doing java for a while. But I am thinking I may have >unfortunately started off the wrong way. Maybe. Outerlying file >structures have no convention. Seems that the open source community is >the driving force to one convention that seems to be the norm. I would >like to know if there is a website that talks about the conventions >normally used. If not I believe one needs to be developed. There are some conventions, but no "standard" one. The one I prefer is this: <root> |- src/ |- |- java/ |- |- tests/ |- |- resources/ |- build/ |- |- classes/ |- |- tests/ |- |- gen-src/ <== For generated src |- docs/ |- lib/ |- build.xml |- build.properties |- webroot/ <== For Web based stuff My build script deploys required files to webroot... Tomcat docbase points to webroot. >Currently the way I do it. I have a development folder, and in this >development folder I have my customers. Within the customers I have the >projects that I am doing for them. Welll. The above example is for a single project. Above that, I usually have similar to what you do: <root> |- project1 |- project2 ... >The next question is how do I organize the source file packages? >For example, say I am making a web app. Do you package like this? > >com/mycorp/sales/servlet/Something.java > >where the use case is before the technology or vice versa > >com/mycorp/servlet/sales/Something.java? I do a combination of both. com/mycorp/project/Something.java com/mycorp/project/web/SomethingServlet.java >I guess I am asking is what is the convention for package naming in any >environment is it technology driven or use case driven? Do you have >your own methods of packaging? I guess I'm coping out by saying it depends. If something is always going to be web based, such as servlets, ec. Then I have a subpackage for web stuff. -- now with more cowbell == 3 of 3 == Date: Mon, Oct 11 2004 1:51 pm From: Frank <[EMAIL PROTECTED]> The Abrasive Sponge wrote: > Ok I have been doing java for a while. But I am thinking I may have > unfortunately started off the wrong way. Maybe. Outerlying file > structures have no convention. Seems that the open source community is > the driving force to one convention that seems to be the norm. I would > like to know if there is a website that talks about the conventions > normally used. If not I believe one needs to be developed. > > Currently the way I do it. I have a development folder, and in this > development folder I have my customers. Within the customers I have the > projects that I am doing for them. *snip* > Now I am thinking I am doing this the wrong way. I am wanting to do > commit to a standard. Would any of these be a correct convention > (below) of organizing file structures or do you have better ideas for this? > > <Root> > |- development > | |- customerA > | |- customerB > | |-webAppA > | | |-build <- would a build file go here? > | | | or just the resulting deliverable? > | | |-src <- source files only? > | | |-actions <--technology driven > | | |-servlets > | | |-listeners > | | |-lib <- libraries other jars needed etc? > | | Personally, i find the netbeans (4.0) default web-app structure fair enough: <project> |-- build.xml <- Goes in project root directory. |-- build <- All contents/structure for the .war, built/copied to a temp folder named 'web'. (Nothing you want to keep in here, it's a just temp folder, deleted along with 'dist' before a clean build.) |-- dist <- .war file |-- src <- Anything .java in here. Duplicate the package structure from the examples of whatever framework you're using. |-- web <- jsp/html/images/whatever |- META-INF |- WEB-INF |- lib <- My libs are all stored externally, but this would be the place to put them? Or better make it a root dir? As for keepin track of projects / customers, I'd say go for Subversion (http://subversion.tigris.org/). I prefer one project each repository myself. I'm fairly new to the whole j2ee thing, so take this with a grain of salt or two. May wery well be talking out of my ass here. -Frank ========================================================================== TOPIC: Why can't I get Tomcat to hot deploy? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/61cdbd0946791b2e ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 11:29 am From: "PerfectDayToChaseTornados" <[EMAIL PROTECTED]> "Ben" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | So I know Tomcat is able to hot deploy but for some reason can't get | mine to do it. I've installed several different versions on a few | different computers and have "autoDeploy=true" in my server.xml file | and I always have the same problem. What am I missing? (I'm running | Tomcat on Windows) | | Ben I think that Tomcat only hot deploys exploded directories, not war files. You can use the manager app or ant tasks to reload the war file. -- -P "Programs that are hard to read are hard to modify. Programs that have duplicated logic are hard to modify. Programs with complex conditional logic are hard to modify" ( Kent Beck) ========================================================================== TOPIC: Concurrent Logging: How? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1e88399af98f57e5 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 11:32 am From: [EMAIL PROTECTED] (scott) The latest version of Chainsaw V2 can help you once you've added unique identifiers to each event (via MDC) to slice & dice logs - you can even combine client and server logs together. Chainsaw V2 is available via WebStart here: http://logging.apache.org/log4j/docs/chainsaw.html Chainsaw can display and tail a log file generated by any logging framework using LogFilePatternReceiver. Here's a link to the LogFilePatternReceiver javadoc, describing the 'logFormat' keywords: http://cvs.apache.org/viewcvs.cgi/logging-log4j/src/java/org/apache/log4j/varia/LogFilePatternReceiver.java?rev=1.19&view=auto If you want to tail your log file, modify the below-provided xml as needed and save as chainsaw.xml. Inside Chainsaw, select: view-show application wide preferences - enter the URL of this chainsaw.xml in the 'automatic configuration URL' field - restart chainsaw chainsaw.xml: ------------------------------ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> <log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true"> <plugin name="logFileReceiver" class="org.apache.log4j.varia.LogFilePatternReceiver"> <param name="fileURL" value="file:///c:/downloads/log4j/sample.log" /> <param name="timestampFormat" value="yyyyMMddHHmmssSSS"/> <param name="logFormat" value="TIMESTAMP LEVEL(FILE:LINE)#CLASS,LOGGER THREAD!MESSAGE"/> <param name="name" value="logfileReceiver" /> <param name="tailing" value="true" /> </plugin> <root> <level value="debug"/> </root> </log4j:configuration> ------------------------------ Hope this helps - there is a tutorial available from the 'Welcome' tab that explains how to use it. Feel free to send an email to the log4j user mailing list with questions: http://logging.apache.org/site/mailing-lists.html Scott Calum Grant <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Ravi Shankar wrote: > > Hi all, > > > > I have an enterprise application. I am using Apache Log4J for the logging > > purposes. WHen a request is received by the application, it goes throug > > servlets and many classes, and the necessary details are logged to files, > > which has autorate option. I mean when certain file exceeds the size, > > automatically another file is generated for a maximum of 10 files and then > > again starts from the first. > > > > So far is so good. Now assume that say 100 users are concurrently making a > > request. Since servlets are mutithreaded, the logs generated does not show > > each request sequentially. All the logs of all the requests are mixed > > together making it difficult and highly spagettic to read and understand. > > > > How can I make the logging strategy such that each user request is written > > in a sequential manner so that there are no overlaps of the logs? Please > > advise, thanks > > You'd need to write a unique request-id in each line of the log. Then > you can apply filters (e.g. grep, perl) to extract useful information > from the log. You could write (or get someone else to write) a script > to process these log-files and collate requests. > > You can also use SQL for logging, so then it's slightly easier to apply > queries and filters, for example to order by (request-id, time) instead > of just time. > > Calum ========================================================================== TOPIC: looking for example of problems when accessing GUI items in non event dispatch thread http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6eb292f53e7433ca ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 4:40 am From: "Matt Humphrey" <[EMAIL PROTECTED]> "Alex Hunsley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm looking for ideas for some test code that demonstrates that > accessing GUI items (in Swing) from a thread other than the event > dispatch thread leads to problems. > Ideally, I want to write a small app that does things the "bad way" and > ably (and repeatedly) demonstrates that a problem arises. Anyone have > any ideas of a way to do this? > > The nearest parallel to the sort of thing I'm thinking of is the java > program on Sun's site that demonstrates that getting and putting items > into a cubbyhole, without appropriate sychronisation locks, results in > some items being not 'got' at all, or got more than one time.... Just do it. Create a thread that changes the properties of any of the UI elements. The more frequently threads change things the sooner you'll see things messed up. Cheers, Matt Humphrey [EMAIL PROTECTED] http://www.iviz.com/ ========================================================================== TOPIC: JSP: error page exception.getMessage returning null for setProperty exceptions http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/570e60d4493f982d ========================================================================== == 1 of 5 == Date: Mon, Oct 11 2004 11:54 am From: kaeli <[EMAIL PROTECTED]> Hey all, I have a little problem. My error page (JSP) seems to not be getting the exception text for some reason when my beans throw exceptions in the setters and I use setProperty. The errors do fine when I use other methods. This is the only case in which they aren't working. Here's the setup. Can someone tell me what I'm doing wrong? In the bean: (many similar methods; this one is generic for illustrative purposes) public void setField(String str) throws IllegalArgumentException { // limit 10 chars (null allowed) if (str!= null && str.length() > 10) { throw new IllegalArgumentException( "Field must be 10 characters or less."); } this.field = str; } In the JSP: <%@ page isErrorPage="false" errorPage="err.jsp" %> ... <jsp:useBean id="myBean" class="myPackage.myBean" scope="page" /> <jsp:setProperty name="myBean" property="*" /> <% myBean.testUpdate(s.getPerms()); %> Err.jsp (note that "exception" is an intrinsic JSP object, like "out") <p class="bigAttention">Message: <%= exception.getMessage() %></p> When exceptions are thrown from the testUpdate method in the bean, they forward just fine to err.jsp. When thrown from the setters, I get null when I try exception.getMessage (or just JasperException when I do toString). Sample from using toString: --------------------------------- Message: org.apache.jasper.JasperException Stack Trace: org.apache.jasper.JasperException at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper (JspRuntimeLibrary.java:199) at --------------------------------- When testUpdate fails: --------------------------------- Message: This operation requires permissions. You either have VIEW permissions or aren't logged in. Please LOG IN if you haven't, then try again. Stack Trace: java.lang.IllegalAccessException: This operation requires permissions. You either have VIEW permissions or aren't logged in. Please LOG IN if you haven't, then try again. at --------------------------------- When I used getMessage, it was similar, but Message was null instead of JasperException. WTF? Anyone? -- -- ~kaeli~ Black holes were created when God divided by 0. http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace == 2 of 5 == Date: Mon, Oct 11 2004 1:08 pm From: "John C. Bollinger" <[EMAIL PROTECTED]> kaeli wrote: > Hey all, > > I have a little problem. My error page (JSP) seems to not be getting the > exception text for some reason when my beans throw exceptions in the setters > and I use setProperty. The errors do fine when I use other methods. This is > the only case in which they aren't working. > Here's the setup. Can someone tell me what I'm doing wrong? You are assuming that an exception must have a non-null message. That is not the case. I note that the message-less exception you are reporting is a JasperException, which is generated by the Tomcat JSP runtime engine. This may be thrown in response to an exception in a setter (in which case you might be able to get the original exception via getCause()), or for some other reason. John Bollinger [EMAIL PROTECTED] == 3 of 5 == Date: Mon, Oct 11 2004 1:23 pm From: kaeli <[EMAIL PROTECTED]> In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] enlightened us with... > kaeli wrote: > > > Hey all, > > > > I have a little problem. My error page (JSP) seems to not be getting the > > exception text for some reason when my beans throw exceptions in the setters > > and I use setProperty. The errors do fine when I use other methods. This is > > the only case in which they aren't working. > > Here's the setup. Can someone tell me what I'm doing wrong? > > You are assuming that an exception must have a non-null message. That > is not the case. It is when I set it myself. The exception that is thrown and that should be reported is the one I posted. throw new IllegalArgumentException( "Field must be 10 characters or less."); This is in testing, so I know for sure what the exception is. Also, when I use the method instead of the jsp setProperty, it fires off fine. I'm trying to get code out of my JSP pages and into tags where it belongs. Right now, the production code sets all object members like objectName.setField(request.getParameter("fieldName")); In that case, the error message is done correctly. It is only failing when I use setProperty. > > I note that the message-less exception you are reporting is a > JasperException, which is generated by the Tomcat JSP runtime engine. I'm not using Tomcat. I'm using Netscape Enterprise Server. The exception is NOT supposed to be handled by the jasper engine, which is the point. I don't know why it is being handled that way. It should not be (or I don't want it to be if for some reason this is normal with beans). Something is passing it off and I don't know why. Thanks, though. -- -- ~kaeli~ Press any key to continue or any other key to quit http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace == 4 of 5 == Date: Mon, Oct 11 2004 1:42 pm From: Sudsy <[EMAIL PROTECTED]> kaeli wrote: <snip> > I'm using Netscape Enterprise Server. The exception is NOT supposed to be > handled by the jasper engine, which is the point. I don't know why it is > being handled that way. It should not be (or I don't want it to be if for > some reason this is normal with beans). Something is passing it off and I > don't know why. Just a "shot in the dark" but I note that IllegalArgumentException extends RuntimeException. It could well be that the container is handling it differently than a "normal" application exception, i.e. one which extends Exception. Of course, without access to the source... -- Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development. == 5 of 5 == Date: Mon, Oct 11 2004 3:00 pm From: "John C. Bollinger" <[EMAIL PROTECTED]> kaeli wrote: > In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > enlightened us with... > >>kaeli wrote: >> >> >>>Hey all, >>> >>>I have a little problem. My error page (JSP) seems to not be getting the >>>exception text for some reason when my beans throw exceptions in the setters >>>and I use setProperty. The errors do fine when I use other methods. This is >>>the only case in which they aren't working. >>>Here's the setup. Can someone tell me what I'm doing wrong? >> >>You are assuming that an exception must have a non-null message. That >>is not the case. > > > It is when I set it myself. > The exception that is thrown and that should be reported is the one I posted. > > throw new IllegalArgumentException( > "Field must be 10 characters or less."); Perhaps I was too zealous about snipping your original post. Yes, I saw that that is what your code throws, but it is not what you reported seeing: [from the original post:] Sample from using toString: --------------------------------- Message: org.apache.jasper.JasperException Stack Trace: org.apache.jasper.JasperException at org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper (JspRuntimeLibrary.java:199) at --------------------------------- As I wrote before, that message shows a JasperException with an empty or null message. > This is in testing, so I know for sure what the exception is. If this is in testing, then you are less likely now than at any other time to know what the exception is. You may have an idea of what the exception is _supposed to be_, but that's an entirely different thing. > Also, when I use the method instead of the jsp setProperty, it fires off > fine. I'm trying to get code out of my JSP pages and into tags where it > belongs. Right now, the production code sets all object members like > objectName.setField(request.getParameter("fieldName")); > In that case, the error message is done correctly. It is only failing when I > use setProperty. I observe that the exception in question is being thrown from a method called "introspectorhelper", and in your example right there you are setting a bean property from a page parameter with a different name. (I.e. it should be objectName.setFieldName(request.getParameter("fieldName")); or objectName.setField(request.getParameter("field")); for the wildcard setProperty action to work.) This all leads me to believe that your page parameter names do not line up with your bean property names, and that you are indeed getting a different exception than you expect, which you have not particular reason to expect will have a non-null message. It is also possible that your object does not comply fully with the JavaBeans spec (it might have getters and setters for the property that imply different types, for instance, or that are otherwise incompatible with the Introspector). >>I note that the message-less exception you are reporting is a >>JasperException, which is generated by the Tomcat JSP runtime engine. > > > I'm not using Tomcat. Jasper is the Tomcat JSP runtime engine. Your exception appears to show that you are using at least that part of Tomcat, as I said. > I'm using Netscape Enterprise Server. The exception is NOT supposed to be > handled by the jasper engine, which is the point. No, I think you're missing the point, which is that something different may be happening than you think. My best guess is that your IllegalArgumentException is never being thrown at all because the the JSP engine is not even finding the method. > I don't know why it is > being handled that way. It should not be (or I don't want it to be if for > some reason this is normal with beans). Something is passing it off and I > don't know why. You are making assumptions about what is happening that you have presented no firm basis for. For example, "something is passing it off" and "it should not be [handled that way]." I find it highly unlikely that any exception thrown by your bean would have its message changed by the JSP container, and indeed, I see no evidence for such a thing. I was wrong, though, when I characterized the problem as an assumption that the exception message was non-null. It seems that's just a symptom of the real problem, which is that you are making a faulty assumption about what exception you should be getting. John Bollinger [EMAIL PROTECTED] ========================================================================== TOPIC: gui hangs in join() http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/60cecb273fbb5b9b ========================================================================== == 1 of 2 == Date: Mon, Oct 11 2004 12:03 pm From: "Inertia_sublimation" <[EMAIL PROTECTED]> Why not have your runnable object trigger an event in the gui object? interface SomeJobListener { public void jobDone(); // Called when SomeJob is finished. } public void SomeJob implements Runnable { private final SomeJobListener callback; public SomeJob(SomeJobListener callback) { this.callback = callback; } public void run() { // Do complex stuff that takes long... callback.jobDone(); // Tell gui that job is done. } } public void YourGUI implements SomeJobListener { public YourGUI() { SomeJob sj = new SomeJob(this); // Register the gui with the job object. Thread jobThread = new Thread(sj); jobThread.start(); } public void jobDone() { // Disable the cancel buttons here. } } "Filip Larsen" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Madhur Ahuja wrote > >> I have 3 buttons. First button starts a complex long >> process, so I create a seperate thread for it. >> >> While it is running, two other buttons are enabled to >> allow abort that process. >> >> I use join to monitor when the thread has finished so >> that I can redisable the other 2 buttons. >> >> However during join, the gui seems to hang, and buttons >> never appear as enabled during that operation. > > As the documentation says, calling thread.join() will block until the > thread is dead, which in your example also means the event dispatcher > thread will be block until the thread is dead. I can think of the > following ways you could do it: > > - start yet another thread in which you will first join the worker > thread and then disable the buttons (using SwingUtility.invokeLater or > similar), > > - put code into the end of the worker threads execution that will > disable the buttons, or > > - periodically poll thread.isAlive() and set button state accordingly. > > > If it was me, I would probably do something like the second one: > > class SomeGUIClass { > > /* ... */ > > protected void startJob(final Runnable job) { > setJobButtons(true); > Thread t = new Thread("worker") { > public void run() { > try { > job.run(); > } finally { > setJobButtons(false); > } > } > }; > t.setDaemon(true); // depends on the job > t.start(); > } > > protected void setJobButtons(final boolean running) { > if (SwingUtilities.isEventDispatcherThread()) { > startButton.setEnabled(!running); > stopButton.setEnabled(running); > pauseButton.setEnabled(running); > } else { > SwingUtilities.invokeLater(new Runnable() { > public void run() { > setJobButtons(running); > }); > } > } > > } > > > > Regards, > -- > Filip Larsen > > > == 2 of 2 == Date: Mon, Oct 11 2004 12:07 pm From: "Inertia_sublimation" <[EMAIL PROTECTED]> Argh! Excuse that brain fart, I accidentally declared each class like this: "public void ClassName" Here's the corrected code: interface SomeJobListener { public void jobDone(); // Called when SomeJob is finished. } public class SomeJob implements Runnable { private final SomeJobListener callback; public SomeJob(SomeJobListener callback) { this.callback = callback; } public void run() { // Do complex stuff that takes long... callback.jobDone(); // Tell gui that job is done. } } public class YourGUI implements SomeJobListener { public YourGUI() { SomeJob sj = new SomeJob(this); // Register the gui with the job object. Thread jobThread = new Thread(sj); jobThread.start(); } public void jobDone() { // Disable the cancel buttons here. } } "Inertia_sublimation" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why not have your runnable object trigger an event in the gui object? > > interface SomeJobListener { > public void jobDone(); // Called when SomeJob is finished. > } > > public void SomeJob implements Runnable { > private final SomeJobListener callback; > public SomeJob(SomeJobListener callback) { > this.callback = callback; > } > public void run() { > // Do complex stuff that takes long... > callback.jobDone(); // Tell gui that job is done. > } > } > > public void YourGUI implements SomeJobListener { > public YourGUI() { > SomeJob sj = new SomeJob(this); // Register the gui with the job > object. > Thread jobThread = new Thread(sj); > jobThread.start(); > } > > public void jobDone() { > // Disable the cancel buttons here. > } > } > > "Filip Larsen" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Madhur Ahuja wrote >> >>> I have 3 buttons. First button starts a complex long >>> process, so I create a seperate thread for it. >>> >>> While it is running, two other buttons are enabled to >>> allow abort that process. >>> >>> I use join to monitor when the thread has finished so >>> that I can redisable the other 2 buttons. >>> >>> However during join, the gui seems to hang, and buttons >>> never appear as enabled during that operation. >> >> As the documentation says, calling thread.join() will block until the >> thread is dead, which in your example also means the event dispatcher >> thread will be block until the thread is dead. I can think of the >> following ways you could do it: >> >> - start yet another thread in which you will first join the worker >> thread and then disable the buttons (using SwingUtility.invokeLater or >> similar), >> >> - put code into the end of the worker threads execution that will >> disable the buttons, or >> >> - periodically poll thread.isAlive() and set button state accordingly. >> >> >> If it was me, I would probably do something like the second one: >> >> class SomeGUIClass { >> >> /* ... */ >> >> protected void startJob(final Runnable job) { >> setJobButtons(true); >> Thread t = new Thread("worker") { >> public void run() { >> try { >> job.run(); >> } finally { >> setJobButtons(false); >> } >> } >> }; >> t.setDaemon(true); // depends on the job >> t.start(); >> } >> >> protected void setJobButtons(final boolean running) { >> if (SwingUtilities.isEventDispatcherThread()) { >> startButton.setEnabled(!running); >> stopButton.setEnabled(running); >> pauseButton.setEnabled(running); >> } else { >> SwingUtilities.invokeLater(new Runnable() { >> public void run() { >> setJobButtons(running); >> }); >> } >> } >> >> } >> >> >> >> Regards, >> -- >> Filip Larsen >> >> >> > > ========================================================================== TOPIC: Admin Console for Tomcat 5 http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/1948f031e265b95 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 12:15 pm From: Juha Laiho <[EMAIL PROTECTED]> "WJ" <[EMAIL PROTECTED]> said: >I've used Weblogic quite a bit. I'm just starting to play with Tomcat 5. >I've read references to a console type web app that does what the weblogic >console does. Is this a 3rd party plugin? I've been googling for a bit and >not found anything on this. Now that you've found the admin console, a warning on using it. It'll make a mess (in readability sense) of your server.xml configuration file. All comments will be gone, along with indentation. But then, I think WebLogic does the same. -- Wolf a.k.a. Juha Laiho Espoo, Finland (GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++ "...cancel my subscription to the resurrection!" (Jim Morrison) ========================================================================== TOPIC: Literature on boolean naming/usage conventions? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/dabf0085d6427c15 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 12:19 pm From: Michael Borgwardt <[EMAIL PROTECTED]> Alex Hunsley wrote: > Doesn't the compiler complain if you write > > if (javaSquished = true) > > anyway? Nope. Perfectly valid boolean expression. ========================================================================== TOPIC: Accessing network drives from 1.4.2 (windows box) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f152296603006240 ========================================================================== == 1 of 2 == Date: Mon, Oct 11 2004 12:22 pm From: [EMAIL PROTECTED] (kalbee) We are attempting to access a network drive to move a file in a Java application and are unable to access or see network drives from within the JVM (??) -- does anyone have a solution? The app is running on Windows 2000 Advanced Server, and we're using the 1.4.2 SDK, and we're managing the synchronization of files across servers dynamically. Thanks, Kim == 2 of 2 == Date: Mon, Oct 11 2004 12:35 pm From: Paul Lutus <[EMAIL PROTECTED]> kalbee wrote: > We are attempting to access a network drive to move a file in a Java > application and are unable to access or see network drives from within > the JVM (??) -- does anyone have a solution? Ask yourself whether the ability to see network drives is available universally in your OS, or limited to specific applications. Tell us whether you have ever been able to do this. And post the code you are using to accomplish this. -- Paul Lutus http://www.arachnoid.com ========================================================================== TOPIC: Moving from Eclipse to WebSphere Application Developer (WSAD) http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2e6c8a871275f6b8 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 12:22 pm From: "Rogue Chameleon" <[EMAIL PROTECTED]> "Tom Davies" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > WSAD is less advanced than Eclipse, in the sense that WSAD is based on > older versions of Eclipse. It is more advanced if you are using > Websphere, in that you can configure a test websphere instance and > deploy to it automatically. > > Tom Thanks for the clear commentary Tom. I've also heard that WSAD makes "enterprise" development a little easier with the introduction of a few wizards (for EJBs).... true? ========================================================================== TOPIC: problem with weblogic 5.1 an new jar files http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4ec8d0c04d0ec9ef ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 1:07 pm From: "[Miren]" <[EMAIL PROTECTED]> hello i am using weblogic 5.1 i want to use the PIO libraries (jar files) for creating excel files. in the weblogic lib directory i have put the jar file but when i use my class tha weblogic says me that doesn't find the class of the jar file. can you help me for solving this grear (for me) problem? thnaks ========================================================================== TOPIC: ASP.NET Mobile control competitor in Java http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/38eb7f312d7830c4 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 3:56 pm From: "andreas kinell" <[EMAIL PROTECTED]> > I'm developing a wireless web application. I'd like to use WAP / WML. > One option is to use ASP.NET Mobile Control (formerly Microsoft Mobile > Internet Toolkit) to build the wireless web application. Basically, > the mobile control will be rendered to appropriate WML (or cHTML) for > different devices. > > Is there any similar technology in Java world? > > Thanks > Dom there is a java wireless toolkit http://java.sun.com/products/j2mewtoolkit/ i still am learning about it myself, i don't know if it does, what you want. HTH, andreas ========================================================================== TOPIC: The most efficient way to innitialize an array with an innitialization list http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/99c3070fafe45d04 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 4:08 pm From: "Dale King" <[EMAIL PROTECTED]> "Mike Schilling" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > What Tor meant to say, I think, is that the version with no "new Type[]" can > only be used to initialize an array-typed referemce, while the other can be > used within any expression. That is: > > int arr1 [] = {11, 15, 19}; // good > int arr2 [] = new int [] {111, 115, 119}; //good > > method(new int [] {111, 115, 119}) // good > method({11, 15, 19}) // *bad* > > The reason being that in the bad case there's nothing to indicate the type > of the array (byte[]? short[]? long[]?) At one point there was a proposal to allow something along these lines. It was JSR-65 for concise array literals. It was basically replaced with the new varargs feature in 1.5 which allows you to do the same without the braces but only for the last argument. ========================================================================== TOPIC: Weird JVM Behaviour? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2c29874b2eb19265 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 4:29 pm From: [EMAIL PROTECTED] (Jussi Jumppanen) Babu Kalakrishnan <[EMAIL PROTECTED]> wrote in message news: > If you read the description of the -jar option in the documentation of > the "java" command, you'll notice what the last line says : > > <QUOTE> > When you use this option, the JAR file is the source of all user > classes, and other user class path settings are ignored. > </QUOTE> In other words the documentation does not match the USAGE produced by the java compiler: java -? Usage: java [-options] class [args...] (to execute a class) or java -jar [-options] jarfile [args...] (***) (to execute a jar file) where options include: -client to select the "client" VM ......... snip ........ -cp -classpath <directories and zip/jar files separated by ;> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ As least to me the (***) line of the usage and the line above say it should have worked!!!!! I thought the bug was all my doing which is why it took me such a long time to get working :( But next time I will know better :) Thanks for the feedback. Jussi Jumppanen Home Page: http://www.zeusedit.com ========================================================================== TOPIC: rmic stub generation http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/b491ad1fa6d05dd0 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 5:00 pm From: Esmond Pitt <[EMAIL PROTECTED]> indo3 wrote: > > I have a question to Java RMI: > why does rmic need the Server Implementation class as input and > not can be satisfied with the inferface file? Because a remote object may implement more than one remote interface, and its stub must do the same. ========================================================================== TOPIC: How to put XSLT element <xsl:value-of> inside an HTML tag? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/184eebeab42880ea ========================================================================== == 1 of 2 == Date: Mon, Oct 11 2004 5:02 pm From: [EMAIL PROTECTED] (Matt) How to put XSLT element <xsl:value-of> inside an HTML tag? For example, how to represent hyperlink in XSL? I want to add hyperlink in XSL. i.e. I need to generate <A HREF="http://mypage.html">home page</A> in HTML. I tried the following approaches but still not work, it don't display anything Approach #1: direct link, not work A) double quote, <A HREF="<xsl:value-of select="/bio/homepage" />">home page</A> OR B) single quote, <A HREF='<xsl:value-of select="/bio/homepage" />'>home page</A> Approach #2: introduce new variable, not work <xsl:variable name="hp" select="/bio/homepage" /> <A HREF="$hp">my page</A> Another example, if I do this, it don't display anything also. <select name='<xsl:value-of select="@id"/>'> any ideas? please advise. thanks!! == 2 of 2 == Date: Mon, Oct 11 2004 5:36 pm From: "Silvio Bierman" <[EMAIL PROTECTED]> "Matt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How to put XSLT element <xsl:value-of> inside an HTML tag? > > For example, how to represent hyperlink in XSL? I want to add hyperlink in XSL. > i.e. I need to generate <A HREF="http://mypage.html">home page</A> in HTML. > > I tried the following approaches but still not work, it don't display anything > > Approach #1: direct link, not work > > A) double quote, <A HREF="<xsl:value-of select="/bio/homepage" />">home page</A> > OR > B) single quote, <A HREF='<xsl:value-of select="/bio/homepage" />'>home page</A> > > Approach #2: introduce new variable, not work > <xsl:variable name="hp" select="/bio/homepage" /> > <A HREF="$hp">my page</A> > > Another example, if I do this, it don't display anything also. > <select name='<xsl:value-of select="@id"/>'> > > any ideas? please advise. thanks!! Use xsl:attribute for this. xsl:value-of is not allowed inside a tag. Silvio Bierman ========================================================================== TOPIC: How to make a whitespace in XSL? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/cf1e91b8d5326e8a ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 5:10 pm From: [EMAIL PROTECTED] (Matt) In XSL, if I want to make a whitespace, I put but not work. How to make a space?? The following won't create any spaces. It will output mytitlemyauthor <xsl:value-of select="title"> <xsl:value-of select="author"> But the following will output mytitle++myauthor: <xsl:value-of select="title">++<xsl:value-of select="author"> any ideas? please advise. thanks!! ========================================================================== TOPIC: how to test an empty element in XSL? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/88329b6f5dc0f3a1 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 5:11 pm From: [EMAIL PROTECTED] (Matt) How can XSL detect empty elements, for example, <author></author> or <author/> ?? The XML structure can be <book> <author></author> <title></title> </book> The XSL has the following <UL> <LI>book author: <xsl:value-of select="/book/author"></xsl:value-of></LI> <LI>book title: <xsl:value-of select="/book/title"></xsl:value-of></LI> </UL> The problem is it will display book author: and book title: even <author> and <title> are empty elements. I tried the following approaches, but still not work. <xsl:if test="string-length("<xsl:value-of select="author" />") > 0"> <xsl:count(<xsl:value-of select="author" />)></xsl:count> any ideas? please advise. thanks!! ========================================================================== TOPIC: Put a comma with conditions in XSL http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/883705942bf1c1e7 ========================================================================== == 1 of 3 == Date: Mon, Oct 11 2004 5:11 pm From: [EMAIL PROTECTED] (Matt) I want to produce item1, item2, item3, etc... in HTML. i.e. it has commas between the items. In XSL, I do the following, but it don't display anything <xsl:if test=<xsl:number/> > 1>,</xsl:if> <xsl:value-of select="item"/> any ideas? please advise. thanks!! == 2 of 3 == Date: Mon, Oct 11 2004 5:39 pm From: "Silvio Bierman" <[EMAIL PROTECTED]> "Matt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I want to produce item1, item2, item3, etc... in HTML. i.e. it has > commas between the items. > > In XSL, I do the following, but it don't display anything > > <xsl:if test=<xsl:number/> > 1>,</xsl:if> > <xsl:value-of select="item"/> > > any ideas? please advise. thanks!! Reading your posts I get the impression you did not read any documentation about XSLT. Start with w3.org, it has a quite readable XSLT spec. Silvio Bierman == 3 of 3 == Date: Mon, Oct 11 2004 5:27 pm From: Sudsy <[EMAIL PROTECTED]> Matt wrote: > I want to produce item1, item2, item3, etc... in HTML. i.e. it has > commas between the items. > > In XSL, I do the following, but it don't display anything > > <xsl:if test=<xsl:number/> > 1>,</xsl:if> > <xsl:value-of select="item"/> > > any ideas? please advise. thanks!! No disrespect, but you posted 4 questions in very short order. Since you can't expect responses to posts in anything less than 24 hours in general, and sometimes never, you'd be better served referring to the documentation. Alternatively, or as a complement, you could search the archives at <http://groups.google.com>. That being said, there are some tricks I've used in my own apps, one of which is the Struts bean:define tag. You could use it something like this: <bean:define id="someVarName"> <xsl:...> </bean:define> From the javadocs (always the first and best source of information): "Specify nested body content - The created attribute and scripting variable will be of type java.lang.String, set to the value of the nested body content." That should directly address question #1. -- Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development. ========================================================================== TOPIC: Division by zero: float vs. int http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/6dc583f6638fa877 ========================================================================== == 1 of 1 == Date: Mon, Oct 11 2004 7:18 pm From: [EMAIL PROTECTED] (Joseph Daniel Zukiger) "Thomas G. Marshall" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Joseph Daniel Zukiger coughed up: > > "Thomas G. Marshall" > > <[EMAIL PROTECTED]> wrote in > > message news:<[EMAIL PROTECTED]>... > >> Joseph Daniel Zukiger coughed up: > >>> "Thomas G. Marshall" > >>> <[EMAIL PROTECTED]> wrote in > >>> message news:<[EMAIL PROTECTED]>... > >>>> Stefan Schulz coughed up: > >>>>> On Tue, 28 Sep 2004 16:56:38 GMT, Thomas G. Marshall > >>>>> <[EMAIL PROTECTED]> wrote: > >>>>> > >>>>> > >>>>>> I've often pondered on this for years. What is the advantage to > >>>>>> disallowing > >>>>>> > >>>>>> Double.Nan == Double.Nan > >>>>>> > >>>>>> aside from the (IMO unimportant) fact that it might be possible > >>>>>> for multiple bit representations to be NaN? > >>>>> > >>>>> The fact that it makes no sense logicwise. Is the natural > >>>>> Logarithm of -2 the > >>>>> same as the natural Logarithm of -5? > >>>> > >>>> Yes IMO. And > >>>> > >>>> sqrt(-10) ==should== sqrt(-20) > >>>> > >>>> But it seems that I'm likely to be the minority here... > >>> > >>> So subclass Double. > >> > >> So no. It's final. > > > > Nothing's final if you're willing to do a little drudge work. Wrap > > the class. > > (Double).equals() already works. Let's stop this---I don't want us moving > into circles of already (usually) understood behavior. Oh, come on. Moving in circles is soooo much fun! Just kidding. But I'm still wondering, if you knew the functionality was available, why argue in favor of making a floating point primitive do non-primitive things? I mean, your argument has enlightened me on one little dark corner I'm not going to like about Java (more of the implications of envelope classes for primitive types being final), but was that your purpose? JouDanDeshita ======================================================================= 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
