Jon Greenwood

+ Follow
since Mar 13, 2011
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jon Greenwood

I am a professional software developer of many years learning scala for new commercial project. Primarily I'm learning from Martin Odersky's book.
Whenever I veer onto the internet to find out why I should learn Scala the general theme is that it's a steep learning curve but worth it as X,Y,Z reveals itself.
I believe this is probably true and will preservere, however 14 chapters in and I spend most of my time viewing Scala as a command line application that runs in java. To date, and in the context of already knowing java, I would describe Scala as "unnecessary"
1 year ago
My assumption was that

(similar to if statements)

the default would evaluate to true and become the execution point

Clearly that cannot be the case

so I assume that
all cases must be evaluated
and then the default (regardless of the order of the statements)

Question is that execution point defined at Compile or at runtime?

It would appear to be defined at Compilation

for the given code

The output is

This surprises me.
I would have expected

How do I interpret this?
Given that case statements have to be compile constants then what actually happens when a class is compiled?
It must mean that a map or similar construct is created of the case statements and runtime merely outputs the contents of that map.

What I am struggling with is that the CharSequence interface violates the statement

A class that implements an interface must implement all the methods declared in the interface.

Summary of Interfaces
3 years ago
I can create the following Class

I am not explicitly implementing the toString() method

so I assume I am calling Object.toString()
3 years ago
Can somebody explain why the Interface CharSequence contains the toString() method?

String toString()
Returns a string containing the characters in this sequence in the same order as this sequence. The length of the string will be the length of this sequence.
toString in class Object
a string consisting of exactly this sequence of characters

If I create a Class that implements CharSequence then I don't need to implement the toString() method

If I do override it then surely I am overriding the object.toString() method

So why does CharSequence.toString() exist?

3 years ago
Anonymous Class - That's the phrase I'm after.

Thank you very much.

5 years ago

What is the correct terminology for a Method that is Overridden at Instance level.

Example, the given class has a Method checkYourself that returns the String "miss".

I am familiar with the idea of a subclass overriding the Method to produce different behaviour.

But what if I create an instance and override the method like this,

This method is overridden at instance rather than class level.

How would this be described in TextBooks?

Thanks in advance

5 years ago
Hi John

I am just about to start a BDD development role using Cucumber JVM and so was about to purchase

The Cucumber Book: Behaviour-Driven Development for Testers and Developers (Pragmatic Programmers)

What does BDD in Action offer that's different and therefore why I should consider purchasing it?


5 years ago

My boss asked me a really good question yesterday, "Is XSLT data or code?".

We have a J2EE application that retrieves XML data from a database which is then sent on to customers.
Before being sent onwards it may have a stylesheet applied to it to transform the data.

There are less than 10 stylesheets and there will not be more (so no need to future-proof application).

Given these circumstances, should those stylesheets be retrieved from the database (are they data) or should they reside in the Dynamic Web project (are they code).

Either solution will work but can anyone guide me as to a preferred Design Solution?

Thanks in Advance

I am trying to understand how to amend the <soap:address location=
attribute for the WSDL of an Axis2 webService deployed locally on JBoss.
This was originally an Axis1 webService. It does NOT use annotations to define @WebService


I am able to amend the services.xml file and remove <operation> elements and change the <parameter name="ServiceClass"> to an empty ServiceClass.
This successfully removes the operations but has no bearing on the <wsdl:port>.
I am beginning to think that this is configured by JBoss.

Can anyone please advise how this part of the WSDL gets generated?

Thanks in advance
6 years ago

I have a struts 1.3 application.

I have a new <html:text> field in a .jsp that maps to a formsbean.
The formsbean has its getters and setters correctly working.

The variable is of type int and it is defaulting to 0 in the .jsp.

What is the best way of ?nulling? this field in the .jsp?

Thanks in advance
6 years ago

Would appreciate any pointers to designing a way of displaying certain special characters in HTML.

I have a struts 1.3 application which connects to an old database using web services. Some of the data contains special characters such as 'soft hyphen' ascii 173.
This does not display in an HTML browser.

If I wanted to display some special characters, what would be the best way of implementing this?

Can it be achieved by CSS, or a global javascript function, or is there a better way?

All references greatly received.

Thanks in advance

I'm new to Struts and am looking for help with client-side event handling.

I have a .JSP which is associated with an Action. That Action queries a DataSource. In a fat client like Swing I would be able to get a handle to Component and register a listener to, for example, change the cursor to an hourglass whilst processing. With Struts can I get a handle back to the .JSP to set the style="cursor:progress"?

Alternatively is there a way to do this in Javascript?

Thanks in advance
6 years ago