|
zootm posted:Flying somewhat blind: The JAXP tutorial has the following example: http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXPXSLT4.html
|
# ¿ May 3, 2008 10:26 |
|
|
# ¿ May 19, 2024 18:43 |
|
Fehler posted:Speaking of executing commands, is there any way to do something like "mailto:foo@bar.com?subject=1" in Java? If you're trying to send emails, you can use the java mail API which provided you have all the correct SMTP settings can send email.
|
# ¿ May 25, 2008 11:44 |
|
mister_gosh posted:I'm unclear on the concept here. I want to put stuff into a HashMap and at a later time, retrieve the objects from the map by iterating through it and processing every object. I want it to be in the order that I originally put them in. java.util.LinkedHashMap seems to be what you want: API Docs posted:Hash table and linked list implementation of the Map interface, with predictable iteration order. This implementation differs from HashMap in that it maintains a doubly-linked list running through all of its entries. This linked list defines the iteration ordering, which is normally the order in which keys were inserted into the map (insertion-order).
|
# ¿ Jun 1, 2008 14:12 |
|
schzim posted:JavaSeverFaces and JavaServerPage Goons to the rescue please k thnx. I believe what you're after is the pageContext.setAttribute method, to be used like so: code:
|
# ¿ Aug 5, 2008 17:42 |
|
Startacus posted:Hey, I can use some help here. I have a program where I have an array of objects and I want to output them to a .csv file. Right now the object just holds variables for name and grade, both of them are strings (Although I should parse an int from the grade but I can do that later). code:
JingleBells fucked around with this message at 01:25 on Aug 9, 2008 |
# ¿ Aug 9, 2008 00:34 |
|
Startacus posted:That works great except for some reason it doesn't add a comma every other time. So I will have a name and grade separated by a comma on one line, like it's supposed to. Then on the next line I will just have a name and the line after that, just a grade. It does that back and forth, weird. It might be worth adding .trim() to your calls to getName() and getGrade() then, it sounds like your values may have carriage returns/new lines in it? code:
|
# ¿ Aug 9, 2008 01:24 |
|
Vandorin posted:I've got a problem just compiling my code. I wrote it in class, and on those computers it ran fine, but when I try to run it on mine, it gives me the error "cannot find symbol - method drawRectangle (int, int)" I can't get any of it to compile as I'm missing the SimpleTurtle and SimplePicture classes, what else is in the Guzdial package?
|
# ¿ Sep 1, 2009 20:02 |
|
Anunnaki posted:How do you do input from the console to multiple variables? In C++, you would do something like cin >> var1 >> var2;, but even my professor told me you have to just write one input command for each variable. Somehow I doubt this.
|
# ¿ Sep 13, 2009 00:20 |
|
Newf posted:OK, so more trouble from the resident java noob. Have you got an import for java.util.InputMismatchException ? It's not in the java.lang package
|
# ¿ Jul 24, 2011 18:24 |
|
I'm having some trouble with various JAXP implementations and some XML I've got. I'm using JWebUnit with HTMLUnit to test a webpage which is using AJAX to retrieve some XML from the server, the XML has empty CDATA sections in it, like so: code:
JWebUnit mimics a web-browser, including down to handling XML via AJAX - however it uses a JAXP DocumentBuilderFactory implementation to get the String into an XML object. The XML becomes as follows: code:
I've tried the following JAXP implementations: Built in Java 1.6 Xerces 2.9 & 2.11 Oracle XDK Crimson Saxon 9.2 & 9.3 (Interestingly 9.3 has deprecated the DocumentBuilderFactorImpl and suggests using Xerces) All of them remove the empty CDATA node. I know the problem is actually due to the way Microsoft parse XML in Internet Explorer, but I can't change the web application code, nor can I change from JWebUnit + HTMLUnit - are there any other JAXP providers I've missed? The only resources I've found referring to this seem very out of date. Otherwise I'm going to have to break the HTMLUnit code and manually try and add empty CDATA nodes once the String has been parsed into a Document, which won't be pretty JingleBells fucked around with this message at 00:19 on Sep 5, 2011 |
# ¿ Sep 5, 2011 00:17 |
|
If anyone cares I've managed to find a workaround for my XML parsing issues - I found that someone had submitted a patch to Xerces for this, but it's never been implemented. So I built myself a copy of Xerces with the patch, and then had to fix a bug in HTMLUnit where if it's mimicing Internet Explorer it treats empty DOM Text nodes as empty nodes and uses the short form XML, and CData nodes are subclasses of DOM Text nodes - so they also get shortened. Not sure whether to submit the bug to the HTML Unit team seeing as it only appears when using a hacked XML parser
|
# ¿ Sep 5, 2011 12:55 |
|
wins32767 posted:Is there a tool out there that will attach to a running Servlet container and log all of the method calls that are made? I'm trying to generate some system documentation for a framework whose developer is no longer with the team and stepping through the code manually is going to be pretty painful. You could use AspectJ and set the aspect to match all method calls, a quick google suggests this might work. Be careful - I did this once by setting the wrong aspect, and logged every method call in all the libraries I was using too
|
# ¿ Aug 15, 2012 20:54 |
|
|
# ¿ May 19, 2024 18:43 |
|
Jose Cuervo posted:I have been programming in Python but now am trying to modify someones code that is in Java. Is there a reason that this person would not have used this.ID instead of ID in the getID() function? I cannot tell why they would have omitted it. Pure code style - there's no difference as there's no other ID variable in scope. If you have a class like this: Java code:
Java code:
|
# ¿ Apr 7, 2014 23:12 |