Max White

Ranch Hand
+ Follow
since Jun 28, 2008
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 Max White

I guess, I am missing the point. I understand that it can be made final, but then it's a reference to an object. Once I make it final, the reference can't be changed. Am I wrong?
5 years ago
I have a task in java that is taking a bit long, so I implemented it using thread.

My question is how do I segregate the task for an executor using an inner class?
I am using Java 1.6
5 years ago
I am using the following setup to deploy REST webservices & it works.

Using above setup, Tomcat scans WEB-INF/classes & WEB-INF/lib for the REST resources

I changed it to the following to use Application sub-class for deployment

But still the server is scanning WEB-INF/classes & WEB-INF/lib for the REST resources

It seems to ignore the Application sub-class config in web.xml.What am I missing?

I am using Tomcat 6.0

6 years ago
Do the following change and then try

instead of

Hope you got the point.
6 years ago
I was trying something and came across the below scenario.

When I try to compile the above code ,I get a compilation error-> Unreachable catch block..(as there is nth in the try block to throw SQLException)
But if I change the above code to

It compiles without any error.
Why Exception class is being given a special treatment?
Thanks Tsuji.I got my mistake
I am trying to convert the attribute text to upper case.
Sample xml -

xsl -

The output xml contains everything from the source xml but the attribute.
What's wrong in the template, matching attribute?

I am new to xslt and got stuck on 2 things.

1. Every xsl file needs the following element.

According to the document the namespace can be any unique string, but if I change the string or just the case of any of the alphabet ,I get the following error-

Note : I am using xalan for processing.

2.I have a following xml

and xsl, to copy the above xml.

It works fine but if I change the xls to

The change is within [b]
I get an empty file.My question is why?Isn't "info" descendent of root element "data"?Doesn't "/" represent root element,in this case "data"?

Thank you all for the answers.
Gurpeet is right,case 1 wont compile.Its my mistake.
When I use the following code ..

or the following

The code gets compiled.

But not when I use the following

Error : Final variable may not have been initialised.

My doubt is that it works if I just use either a final or a static variable and the variable gets the default value of null.
Why does it not work with static final ?
I am sorry Junilu.
I know about the recent changes.My question was out of curiosity.
As you can see in the code , whats the need of having synchronized block after the line which checks for not null instance?
What if we put the not null check within the synchronized block?

Second,how to implement the singleton in a distributed environment(more than one jvm) so that there is only one instance of Singleton class.

Thanks for your time.
Hi ,
I have the following doubt in the singleton pattern.

Kindly ignore the typing errors in the above code.The point at issue is, if we write the code as I did above, it results in double-checked locking.
So, if I change the code as shown below, would it be correct & free from double-checked locking?

Second,how to implement the singleton in a distributed environment(more than one jvm) so that there is only one instance of Singleton class.
I have the following content in the html response

I have to extract the value of the above input tag.I have tried both regexp and xpath extractor but neither is working for me.

regexp pattern

I tried the below pattern also

I verified the above pattern in java & it works.I was able to fetch the value with

xpath query

In XPATH Assertion listener I got the error -> No node matched
I modified the xpath query to below

The above does not give any error.The moment I add the actual name,I get the error -> No node matched.

Kindly suggest me how to resolve the issue.
6 years ago
It's not public unless you use the keyword.
7 years ago
Could you get the code of the method adding 2 numbers?
7 years ago