comp.lang.java.programmer http://groups-beta.google.com/group/comp.lang.java.programmer [EMAIL PROTECTED]
Today's topics: * Java and Autonomy - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e0f9cc3c246f2a2 * JTextArea question - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b5070301a6779b * Efficient way of dynamically invoking a method that returns a primitive type? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7bcb9be06f3aeec1 * swing JInternalFrame focus management - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a071968367d7dcc * Invoking 'diff' from java with piped input - 4 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a587b43b3b207a9f * Good Tutorials? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e1bfe9d64672b57e * Java and xmlrpc? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e4304527fb69e181 * "static" prefix - to parallel "this" prefix - 2 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157 * This group is new? - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9a9e7de1fff77726 * Eclipse: List of TODO tags in Task view - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/00ec03d9704ddd3c * HttpServletResponse - 2 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9f313cc803055284 * 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 * 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 * jsp <c:out> - question - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/25a37d7357bbaca7 * Naming convention for Session Facade? - 3 messages, 2 authors http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e173d211c7b8428b * IBM human resources may be stealing from you - 1 messages, 1 author http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2ed64b5ab0c7774d ============================================================================== TOPIC: Java and Autonomy http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/5e0f9cc3c246f2a2 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 3:26 pm From: karl wettin Alberto wrote: > As the matter of fact, I did look up google and most hits don't help at > all. I also checked Autonomy's website and I found very confusing the > way they refer to old names (e.g. DRE=SUIRs). I'm working on using the > fetches Autonomy provides (FileSystem, NotesFetch, > PSTFetch..etc..etc...) I'll try to find a way to automate the process > but in the mean time, if there is anyone there with few tips... google > is not too helpful for now... :( > What is it that you want to automate? Isn't the built in tools enough for your fetches? -- karl ============================================================================== TOPIC: JTextArea question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/3b5070301a6779b ============================================================================== == 1 of 3 == Date: Wed, Dec 8 2004 2:45 pm From: David Segall "Ryan Tan via JavaKB.com" <[EMAIL PROTECTED]> wrote: >Yes I am sure. I am using JDK 1.4.2_04 on windows. That's odd. I can copy to the clipboard using JDK 1.5 and Windows XP. Of course, the process is different from copying from an editable document because a single mouse click does not insert a cursor. >Any ideas are appreciated :) == 2 of 3 == Date: Wed, Dec 8 2004 9:20 am From: "Ryan Tan via JavaKB.com" Hi Mr Kalakrishnan, yes I am setting it as non-editable using the .setEditable(false) method. Here is how I create my JTextArea: protected JTextArea txtMyText; .... txtMyText = new JTextArea(7, 40); txtMyText.setEditable(false); txtMyText.setLineWrap(true); txtMyText.setWrapStyleWord(true); JScrollPane scrollPane = new JScrollPane(txtMyText,JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); ... myPanel.add(listScrollPane); Am I doing something wrong here? As far as I can see, I am not explicitly doing anything to interrupt the normal functionality of the JTextArea. Thanks for the help guys. -- Message posted via http://www.javakb.com == 3 of 3 == Date: Wed, Dec 8 2004 9:22 am From: "Ryan Tan via JavaKB.com" Sorry, the code where it says myPanel.add(listScrollPane); should say myPanel.add(scrollPane); instead. -- Message posted via http://www.javakb.com ============================================================================== TOPIC: Efficient way of dynamically invoking a method that returns a primitive type? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/7bcb9be06f3aeec1 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 3:49 pm From: Michael Borgwardt Andreas Jakobik wrote: > is there an efficient way to dynamically invoke a method that returns > a primitive type? I'd like to avoid the Object to primitive type > conversion. The temporary object wrapper should not have to be created > at all. No, there is no way to do this. It's a meaningless premature optimization, since you're already being so inefficient by using reflection that it doesn't matter. ============================================================================== TOPIC: swing JInternalFrame focus management http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/4a071968367d7dcc ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 4:22 pm From: "Andrei Kouznetsov" >I am doing a lot of work with a JInternalFrame based gui. I have one > desktoppane and hundreds of possible JInternalFrames that can be opened > and closed within it. There are often layers of JInternalFrames sitting > on top of each other, many are derived from each other. My problem is > that when a JInternalFrame is disposed or hidden then the > JInternalFrame below it is visible but it does not automatically gain > focus. My application is very keyboard friendly and enables the user to > do most things by typing and hotkeys. But when a JInternalFrame closes > and then nothing has focus they have to take their mouse and manual > click on it before they can start typing again. > So I am wondering if there is a reasonable way to manage it so when a > jinternalframe is closed the layer beneath automatically gains focus? it is _done_ automatically (at least in 1.4)! May be you have some error in your code? -- Andrei Kouznetsov http://uio.dev.java.net Unified I/O for Java http://reader.imagero.com Java image reader http://jgui.imagero.com Java GUI components and utilities ============================================================================== TOPIC: Invoking 'diff' from java with piped input http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/a587b43b3b207a9f ============================================================================== == 1 of 4 == Date: Wed, Dec 8 2004 4:39 pm From: Gordon Beaton On Wed, 08 Dec 2004 16:16:14 +0100, David Kensche wrote: > I want to call GNU diff from a java class with the following command > > diff -u r2.txt r1.txt > r2r1.patch > > except, that the three files don't exist, that is I have given the > input as two Strings and I want to read the output from a Stream. > Afaics I have to invoke > > Process diffProc = Runtime.exec("diff -u"); > > and then can read the the result from the InputStream available by > > diffProc.getInputStream(); > > My problem is: how do I give the input? I assume there has to be a > way to pipe the Strings to the process but I can't make out how. > Has anyone tried something similar successfully? Any process has only one standard input stream. It can't read from two such streams simultaneously, however it can read from stdin. You tell it to do that by specifying a hyphen (-) as of one of the filenames. This is described in the diff documentation. Your program can write to its stdin by writing to diffProc.getOutputStream(). FromJava you can write to named pipes using regular file operations, so presumably you could create a named pipe and pass its name to diff, then then write to it from your Java program. You will need to use an external helper to create the named pipe however (mknod or mkfifo). If this seems complicated, consider writing the data to two temporary files and passing their names to diff. Alternately, there may be a Java version of diff that you can invoke directly. For example, this: http://www.bmsi.com/java/#diff /gordon -- [ do not email me copies of your followups ] g o r d o n + n e w s @ b a l d e r 1 3 . s e == 2 of 4 == Date: Wed, Dec 8 2004 4:16 pm From: David Kensche Hello, I want to call GNU diff from a java class with the following command diff -u r2.txt r1.txt > r2r1.patch except, that the three files don't exist, that is I have given the input as two Strings and I want to read the output from a Stream. Afaics I have to invoke Process diffProc = Runtime.exec("diff -u"); and then can read the the result from the InputStream available by diffProc.getInputStream(); My problem is: how do I give the input? I assume there has to be a way to pipe the Strings to the process but I can't make out how. Has anyone tried something similar successfully? Thanks beforehand, David == 3 of 4 == Date: Wed, Dec 8 2004 8:53 am From: David Kensche Hello again, I tried to implement the solution with the named pipes. This is my second try. I first tried it without the threads. The result is that diff does not produce output, i.e. in the end 'patchString' is null. When I don't flush nor close the writers I get the same behaviour. On the other hand, if I flush or close (or both) diff does not terminate. Do you know how to handle these streams? Again, many thanks beforehand, David public PatchScript createPatch(final String orig, final String rev) throws DiffFailedException { logger.debug("orig=\n"+orig); logger.debug("rev=\n"+rev); PatchScript patch = null; logger.debug("Write input to named pipes."); new Thread() { public void run() { try { logger.debug("Open pipe to write input to."); Runtime.getRuntime().exec("mkfifo original"); FileWriter oWriter = new FileWriter(new File("original")); oWriter.write(orig); oWriter.flush(); oWriter.close(); } catch(IOException e) { logger.warn("Could not write 'orig' to named pipe.", e); } } }.start(); new Thread() { public void run() { try { logger.debug("Open pipe to write input to."); Runtime.getRuntime().exec("mkfifo revision"); FileWriter rWriter = new FileWriter(new File("revision")); rWriter.write(rev); rWriter.flush(); rWriter.close(); } catch(IOException e) { logger.warn("Could not write 'rev' to named pipe.", e); } } }.start(); try { logger.debug("Start 'diff' process."); Process diffProc = Runtime.getRuntime().exec("diff -u original revision"); logger.debug("Wait for 'diff' to finish."); diffProc.waitFor(); logger.debug("diff-status="+diffProc.exitValue()+". Read patch script."); BufferedReader reader = new BufferedReader(new InputStreamReader(diffProc.getInputStream())); String patchString = null; String line = reader.readLine(); if(line != null) patchString = line; while((line = reader.readLine()) != null) patchString += line + "\n"; logger.debug("patch=\n" + patchString); patch = parser.parse(patchString); } catch(Exception e) { throw new DiffFailedException("Could not create patch script!", e); } return patch; } == 4 of 4 == Date: Wed, Dec 8 2004 9:53 am From: Gordon Beaton On Wed, 08 Dec 2004 17:53:00 +0100, David Kensche wrote: > I tried to implement the solution with the named pipes. This is my > second try. I first tried it without the threads. The result is that > diff does not produce output, i.e. in the end 'patchString' is null. > When I don't flush nor close the writers I get the same behaviour. > On the other hand, if I flush or close (or both) diff does not > terminate. Do you know how to handle these streams? Your code works when I run it, however there may be a race condition when you create the fifos in a separate thread. Do you know that they exist before diff attempts to open them? Create the fifos in the main thread; write to them in the writer threads. Also, in your example, you wait for diff to finish before getting the output stream. To avoid deadlocking, you need to read from diffs output while it runs. If diff's output stream fills and there is nobody reading from it, diff is prevented from continuing (and you block waiting for it). /gordon -- [ do not email me copies of your followups ] g o r d o n + n e w s @ b a l d e r 1 3 . s e ============================================================================== TOPIC: Good Tutorials? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e1bfe9d64672b57e ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 4:18 pm From: "JS" Where can I find good Java tutorials? JS ============================================================================== TOPIC: Java and xmlrpc? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e4304527fb69e181 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 8:01 am From: "shakah" I think the only required jar is xmlrpc-1.2-b1.jar (at least for the version I'm using). As for the webserver, you can "share the connection/stream with an ordinary webserver". For example, you could run the XML/RPC service under: http://[hostname]/services/myxmlrpcserver.jsp without affecting the rest of the web server. ============================================================================== TOPIC: "static" prefix - to parallel "this" prefix http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/f5dde10882ac2157 ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 8:08 am From: Tim Tyler Chris Uppal <[EMAIL PROTECTED]> wrote or quoted: > I agree that a Smalltalk-like class concept would be far preferable to > the Java model (which achieves neither clarity nor simplicity nor > flexibility -- i.e. it's a looser). But I can't see that ever > happening, as you say, to much inertia. But I don't think it's a very > good idea to try to make the Java model look like the ST one with > "tricks" like allowing "this" in static contexts. IMO, it would cause > more confusion than it saves. "The whole hog or none" seems to apply here. Java's "static" context is an irregularitly - and an unnecessary one. If - for whatever arcane security reason, class members can't be associated directly with the class objects, they ought at least to be associated with *some* object. Otherwise you wind up with the Java situation - where there's a whole bunch of extra material in the JLS to deal specifically with static entities, how they are (or aren't) inherited - what happens when a member variable overrides a static one in an inherited class - and so on - all pointless irregularity that makes the langage harder to learn, and makes parsers and compilers more difficult to write. -- __________ |im |yler http://timtyler.org/ [EMAIL PROTECTED] Remove lock to reply. == 2 of 2 == Date: Wed, Dec 8 2004 8:00 am From: Tim Tyler Darryl L. Pierce <[EMAIL PROTECTED]> wrote or quoted: > Chris Uppal wrote: > >>>The name of the class. > >> > >>But you're not specifying the name of the class here. You're specifying > >>the context of the variable in question. That it just happens to *also* > >>be the classname is just a coincidence, and doing that doesn't harm the > >>code or the intention at all. > > > > Most of the uses of the classname are redundant. To see that, change > > the name of the class. All the uses of the classname (within the > > body of the class) that have to change with it are redundant. > > Change the name of an instance variable. All the uses of the variable > (within the body of the class if not the clients of the class) that have > to change with it are redundant. Nonsense: they say which variable you are talking about. Within the definition of a class you shouldn't need to spell out the name of the class - you /should/ just be able to say "this class". > BTW, the above scenario doesn't happen in Eclipse: you refactor and > rename the class and all of those references are updated. *AND* the > references in *other* classes are updated too. Which brings up an > interesting question: how will you refer to static methods/variables in > *other* classes? Are we going to keep the ClassName.staticField pattern? > If so, then we now have *two* ways of doing the *exact same thing* which > to my mind makes the static keyword even *less* attractive. Actually there would be three ways: "ClassName.var" "var" ...or... "static.var". They don't say quite the same thing as each other - though they would all refer to the same static variable. -- __________ |im |yler http://timtyler.org/ [EMAIL PROTECTED] Remove lock to reply. ============================================================================== TOPIC: This group is new? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9a9e7de1fff77726 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 8:05 am From: Chris Smith Diphay Z <[EMAIL PROTECTED]> wrote: > lots of person > The comp.lang.java.programmer programmer has been in existence since July 11, 1996. So no, it's definitely not new. Prior to that date, there was a cmp.lang.java, which was split up into this group and several others. -- www.designacourse.com The Easiest Way To Train Anyone... Anywhere. Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation ============================================================================== TOPIC: Eclipse: List of TODO tags in Task view http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/00ec03d9704ddd3c ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 8:27 am From: Paul van Rossem On 08-12-2004 14:55, John C. Bollinger wrote: > Tzar wrote: > >> I think problem is when I enter a comment like // TODO it does not >> create a task icon on the left edge of the editor (after saving). If I >> manually click on the left edge and select Add Task then it does but >> for some reason it's not doing it for the // TODO comment. >> I tried it on couple of other machines and they work fine. It >> automatically creates a TODO task and it shows it in the Tasks View. > > > It seemed to me that this behavior of Eclipse 2 was omitted from Eclipse > 3, or at least not enabled by default. I last looked into when Eclipse > 3 was still prerelease, however, and I never fully characterized the > problem. > > > John Bollinger > [EMAIL PROTECTED] It still works for me. Eclipse 3.0 split the task tags (todo) and compiler errors into separate panes ("Tasks" and "Problems"). And indeed todos must now be enabled in Window->Preferences ->Java->Task Tags. And, as said before, the Filter setting on the Task view must enable them. That's all I can find about it... Paul. ============================================================================== TOPIC: HttpServletResponse http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/9f313cc803055284 ============================================================================== == 1 of 2 == Date: Wed, Dec 8 2004 8:37 am From: [EMAIL PROTECTED] I am trying to do a response.sendRedirect("http://"+"/servlet/MyServlet"); I get an error: java.io.IOException: Response has been closed I try to do the same in a different servlet it works. Could anyone tell me why I get this error. Thanks in advance Sridevi == 2 of 2 == Date: Wed, Dec 8 2004 9:26 am From: Andrea Desole It looks like the response writer has been closed. You should also check that the response has not been committed, as defined in the HttpServletResponse documentation. [EMAIL PROTECTED] wrote: > I am trying to do a > response.sendRedirect("http://"+"/servlet/MyServlet"); > > I get an error: > java.io.IOException: Response has been closed > > I try to do the same in a different servlet it works. > Could anyone tell me why I get this error. > > Thanks in advance > Sridevi > ============================================================================== 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: Wed, Dec 8 2004 9:02 am From: Joona I Palaste mikeotp <[EMAIL PROTECTED]> scribbled the following: > regards: > Is there any java method which do the following function? > file1-------------------->file2 > The method's handle > file2 is different from file1 by some specific characters. > any suggestion is welcome. public String doFunction(String file1, String file2) { return file1 + "-------------------->" + file2 + "\n" + " The method's handle"; } -- /-- Joona Palaste ([EMAIL PROTECTED]) ------------- Finland --------\ \-------------------------------------------------------- rules! --------/ "I wish someone we knew would die so we could leave them flowers." - A 6-year-old girl, upon seeing flowers in a cemetery ============================================================================== 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: Wed, Dec 8 2004 9:16 am From: Sudsy Alan Gutierrez wrote: > On 2004-12-07, Ryan Stewart <[EMAIL PROTECTED]> wrote: > >>"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. > > > That can't be a good idea. I've put data in WEB-INF, but I'd never > think to put JSP resources there. Is this a common practice? I put almost all application resources (which don't need to be accessed directly by a client) under WEB-INF. I typically have have lib, jsp, dtd and tld subdirectories. As to whether it's a common practice, I'd have to pull some tomes off the bookshelf to be sure but I'm fairly certain that my approach is the recommended one. Goodness knows, classes are kept there... -- Java/J2EE/JSP/Struts/Tiles/C/UNIX consulting and remote development. ============================================================================== TOPIC: jsp <c:out> - question http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/25a37d7357bbaca7 ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 9:19 am From: "ctyberg" I'm trying to re-write this line using c:out. <%request.setAttribute( "view", session.getAttribute("EntityReport")); %> I know that my object is there because the line below works. I see my object's class name... <c:out value="${sessionScope.EntityReport}"/> Then I assign it to the variable "view". <c:set var="view" scope="request" property="${sessionScope.EntityReport}"/> But then I can't see it anymore. The line below does not show the object's class name. View: <c:out value="${view}"/> Any ideas? ============================================================================== TOPIC: Naming convention for Session Facade? http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/e173d211c7b8428b ============================================================================== == 1 of 3 == Date: Wed, Dec 8 2004 9:50 am From: "harry" Seen - xxxEJB xxxSession xxxController xxxFacade xxxService so far! xxxSession & xxxFacade look the most used - any thoughts on which one is most popular/relevant? thanks harry == 2 of 3 == Date: Wed, Dec 8 2004 9:55 am From: Collin VanDyck harry wrote: > Seen - > xxxEJB > > xxxSession > > xxxController > > xxxFacade > > xxxService > > so far! > > xxxSession & xxxFacade look the most used - any thoughts on which one is > most popular/relevant? > > thanks > > harry > > Because you can have session beans that are not acting as facades, I'd think it would be more accurate to name your session beans that do serve that purpose as xxxFacade. == 3 of 3 == Date: Wed, Dec 8 2004 10:01 am From: "harry" good point Collin - thanks! "Collin VanDyck" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > harry wrote: > > Seen - > > xxxEJB > > > > xxxSession > > > > xxxController > > > > xxxFacade > > > > xxxService > > > > so far! > > > > xxxSession & xxxFacade look the most used - any thoughts on which one is > > most popular/relevant? > > > > thanks > > > > harry > > > > > > Because you can have session beans that are not acting as facades, I'd > think it would be more accurate to name your session beans that do serve > that purpose as xxxFacade. > ============================================================================== TOPIC: IBM human resources may be stealing from you http://groups-beta.google.com/group/comp.lang.java.programmer/browse_thread/thread/2ed64b5ab0c7774d ============================================================================== == 1 of 1 == Date: Wed, Dec 8 2004 9:58 am From: mthlv12 If you are a minority at IBM check your credit cards carefully, IBM human resources may be stealing from you. I found $370 of charges on my card, it was done by human resources and it took me 5 months to get it back ============================================================================== 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
