Paul Clapham

Marshal
+ Follow
since Oct 14, 2005
Paul likes ...
Eclipse IDE Firefox Browser MySQL Database
Vancouver, Canada
Cows and Likes
Cows
Total received
55
In last 30 days
0
Total given
109
Likes
Total received
2505
Received in last 30 days
16
Total given
596
Given in last 30 days
8
Forums and Threads
Scavenger Hunt
expand Rancher Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Clapham

I googled the idea of multiple page sequences and the first result I came up with was from the Ranch:

https://coderanch.com/t/559137/languages/XSL-FO-Multiple-Page-Sequences

It all took place seven years ago but then XSL-FO hasn't changed since then. I'd recommend looking at that thread because the person replying is a person who knows what they are talking about.
You have a processRequest(...) method declared. And in its comments it says



This is not correct. It actually does nothing. So if you submit a GET request, you'll get nothing. (Which appears to be what is happening.) You will only get something returned if you submit a POST request. (Warning: I haven't looked at your doPost(...) method in case I was right already.)

It's better not to use the trick where doGet and doPost both call a method which does the actual work. For one thing you normally shouldn't have GET and POST requests which do the same thing.
20 hours ago
Oh yeah, you did that too and I didn't notice. I was looking at



which has the same problem.
20 hours ago
First of all declare your Bar class static, like I suggested. And second, you create objects of the Bar class in exactly the same way you do as if you declared it in its own file.
1 day ago

Jim Venolia wrote:Is it possible to declare a class within a class?


Sure, you can do that. It's called a "nested class" or an "inner class". (There's a distinction but I tend not to remember what the difference is.) You might also want to declare it static, as well. If you don't, then each Bar object has to belong to a Foo object. If the nested class is static, then you can just create Bar objects without having to worry about their Foo-ness.

Seems stupid to have a Bar.java for this silly little Bar class that is only used twice (when creating the list, and when printing it), and is only needed in the Foo class.


Yeah, exactly. That's one reason why the concept exists.
1 day ago

AhFai Chan wrote:Who pays for the Oracle JRE, the developer or the end-user?


That's a matter to be determined between those two. If I'm developing Java code for another organization, then paying the licence fee for Java may be something that my business does. Or I might charge the fee to that organization. It all depends on how the relationship is structured.

Surely the end-user has the choice to use another JRE !?!


That's also a matter to be determined between them. If I'm developing Java code for somebody else than I might want them to use the same JRE, to avoid potential problems. Or they might want me to develop under the same JRE which they are already using. Again, it depends.
1 day ago

Kirk James wrote:I was just talking about the Spring IOC container that manages the bean instances and that cannot work with static elements.



It looks like you've assumed that "cannot" is the right word to use there. It's possible that DI can work with static members but that the designers of Spring have decided not to do that. After all there are serious architectural reasons not to do it, as you already noted.
2 days ago
Technical? I don't understand what you're asking.
2 days ago

Kirk James wrote:Injecting static fields looks like a wrong usage of an OOP pattern (dependency injection), also static fields belong to a Class, not to an Object;



Those are both good reasons not to inject static fields, so I think you have the answer well-covered.
2 days ago

Dave Tolls wrote:I've only ever seen that with third party things where a jar file is missing or of the wrong version.



I've seen it in Eclipse when its link to the JDK is broken for some reason. It may be that the poster's version of Tomcat doesn't have a JDK, or Tomcat doesn't know where it is... sorry, I don't have that sort of experience so I'm just speculating.
2 days ago
JSP

Junilu Lacar wrote:Generally, I try to avoid temporary, single-use variables. The exception is that if it can help me isolate and explain a complex calculation.



The other exception I make is to support step-by-step debugging through code. So I might write



And then I could put a breakpoint on the second line to see what actually happened in "complex calculation". This is a variation on your exception, I think.
3 days ago
Hi Harry, welcome to the Ranch!

I guess you're asking about the PDDocument class in the PDFBox project, am I right?

If so then it looks like you should use the version of the load method which uses an InputStream. You can get one from a URL by following this tutorial: Reading Directly from a URL.
3 days ago

Hari Nagarjuna wrote:but I have seen that string is basically an object that represents sequence of char values...



Sure, that's (almost*) true. But that's a long way from actually being an array of characters.

* I say "almost" true because a String actually represents a sequence of Unicode characters. Java was changed in (I believe) version 1.5, which was released in 2004, so that String objects could represent Unicode characters which aren't in the Unicode BMP. Previously they could only represent Unicode characters in the range up to U+FFFF, which correspond to Java chars.
3 days ago
Way back in ancient history, Java had a mascot named "Duke". I haven't seen Duke for years but I did some googling and apparently Duke is alive and well. Here's a link about Duke, the Java Mascot.

I don't know whether it's catchy or cool but there it is. Do you lose coolness points if you have to explain your camp name?
4 days ago

Piet Souris wrote:Is that 'Jaberwocky' in local dialect?



It's the prologue to The Canterbury Tales, which was written in English (as it was then) in the 16th century.
4 days ago