Jacob Thomas

Ranch Hand
+ Follow
since May 06, 2003
Merit badge: grant badges
For More
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 Jacob Thomas

Thanks for the reply Rob
15 years ago
Thinking about it, I found a solution and is given below:

In this code, I am constructing a new Locale with the correct ISO country code for France(FR) and the wrong language(en). I am pssing this Locale instance to the Currency class and thereby, obtaining the Currency Code for the given country.

Is there any problem by constructing a Locale instance by passing a wrong langauge? Thanks!
15 years ago
Given a ISO 3166-1 country code, what is the best possible way to get the corresponding ISO 4217 currency code in Java? For example, for the country code 'US' I should get the corresponding currency code 'USD'.

Is there any library or utility class providing such facility in Java? I had a look at the Currency class in java but, that gives the currency code for a given locale. Thanks!
15 years ago
I have a top level class called Directory which contains a Set of Folder Objects. In the Folder class, I have another Set of objects called SubFolders. In the SubFolder class, I have properties like fileName, fileSize, uploadDate etc. All of the above classes are modelled as Javabeans with getter and setter properties.

Hierarchically, it is represented as:


How can I access the fileName property using EL? Any help is appreciated. Thanks!!!
16 years ago
I repeat, any FREE plug-ins???
Does anybody know of a free JSP Editor plugin for Eclipse?

Jacob Thomas
I am develpoing an application whereby we have a class called SharedFolder which represents a storage for documents shared by employees in a company. I have another class called UserFolder which represents all the documents of a particular user. For both the classes, I am using a common table in the database named Document_Storage to store the documents.

Now I need an import functionality which allows an user to import documents from the SharedFolder to UserFolder. What is achieved underneath is that a copy of the same document is made in the Document_Storage and associated to the respective user.

What are the various ways by which you can do this in Java. Is clone() method a good way to achieve this functionality? Please give your suggestions. Thank you.
17 years ago
It is easy to implement multiple interface inheritance in Java. But I am asking if there is any hack or work-around solution to do this in Java without the use of interfaces? ie. can you achieve this using classes alone?
17 years ago

I was asked the following question in one of my recent interviews:

There are three classes namely Animal, Fish and Amphibian

The Animal and Fish classes are concrete classes. The Amphibian class should implement the functionalty of both the Animal and Fish classes. What is the best way to do this Java? Thank you
17 years ago
Thanks very much for your reply Senthil. I was confused because all the implicit objects seem to be explicitly initialized in the _jspService() method of the example given in the HFSJ book. If they are explicitlt initalized in the _jspService() method, how are they available in the jspInit() method?
Are implict objects available in jspInit() method or are they available in _jspService() method? For example, can the following code rewritten using implicit objects?

Thanks for the reply Salil. But I disagree with your reply:

just see at the end of page 349 it is mentioned that user want one more instance of same name of same bean but want to set the properly again.
So in the second senario we have changed the scope of the bean . In this case two instances of the same bean will exist one at request scope and the second at page scope.

When the non-nested <jsp:setProperty> tag is used, it resets the bean's property value had the bean already existed. But when <jsp:setProperty> is nested inside the body of <jsp:useBean>, the property setting is conditional and the values will be set only if a new bean is created. ie., there is only one instance of the bean and it exists at page scope.

But I am quite confused by the change of scope in the examples. I checked the errata section of the book given online but didn't find anything regarding this. I know it is not an error per se, but I am puzzled and was wondering if there is any requirement in the specification that demands for a change of scope to a more restrictive one as given in the cited problem. Thank you.
This post is regarding the reason for the change of scope in one of the examples in Head First Servlets and JSP. On page 349, it gives the following code snippet for the <jsp:setProperty> standard action:

On the next page, the <jsp:setProperty> is nested in the <jsp:useBean> tag:

As you can see, the scope is changed from request to page. Is there any particular reason for this change? Thank you.
Dear Siva,

I would like to bring to your attention a simple loophole in your refund offer. I hope you are aware of the recent Sun Certification Promotion of free exam retakes. Here are the details:

Purchase a voucher for most Java technology or Solaris OS certification exams between July 1 and September 30, 2006, and should you need it, you can take the exam one additional time for free. The retake exam must be taken by August 15, 2007 the following year. This offer is available in most countries around the world.

As per this offer, a possible situation is that a person could buy your simulator and take the certification exam and purposefully fail the exam. This makes them eligible for a refund and 50% discount on any product. That's a cool saving of 150% on whizlabs products.

Kindly do the needful measures from anybody exploiting this offer. Thank you.
Does getServletContext() produce a singleton? Are there multiple instances of ServletContext objects?

I was going through some of the examples of servlet applications. Most of them doesn't seem to be using the concept of attributes and listeners. Could somebody please descibe some real world scenarios where they are used?

Thank you.