Help coderanch get a
new server
by contributing to the fundraiser

Paul Brabban

Ranch Hand
+ Follow
since Jan 13, 2008
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Paul Brabban

I just realised, I don't actually know who decides what's in the objectives and who writes the exam questions for the SCJP and other certs.

Is it a Sun thing? Or is there some community element?

(Sorry - not directly related to passing the SCJP, but there isn't a forum for meta-questions about the certification that I can see - please move as appropriate!)
Hi all,

I've got an old app that can only look up files over the network that are shared on a Windows share. I'd like to serve dynamic content to this app and it seems like a viable idea at first thought to have a servlet that talks SMB not HTTP.

Has anyone tried that, or is it just a non-starter - if so why?

Thanks all,
15 years ago
Hi Srividhya

From Javadocs for ServletRequest interface:

The pathname specified may be relative, although it cannot extend outside the current servlet context. If the path begins with a "/" it is interpreted as relative to the current context root. This method returns null if the servlet container cannot return a RequestDispatcher.

So no, request dispatcher can only dispatch relative to the context root.

Good luck in your exam!

Paul
Hi,

I guess it's just that if you don't declare all HttpSession listeners in the DD then the <listener> tag in the DD only declares some of them, not all.

Having said that if I saw this in the exam I would probably get it wrong! I hope that the questions in the exam are phrased more precisely.

Cheers,

Paul
Hi,

I don't think that setting a header in the response affects headers in the request, so request.getHeader("head") could return null or a String object, can't be determined from the information given.

Cheers,

Paul
Hi,

I think it is that the include directive pastes in the source of the included file at translation time (very static) whereas the <jsp:include> action makes a runtime call to the included resource, picking up any dynamic content but at a performance penalty.

You could use either, but I guess you would use the include directive for better performance if you knew the included content would not change.

Cheers,

Paul
Hi,

Attributes of ServletRequest are thread-safe anyway (how would you access an attribute in request scope from another thread?) so no, synchronizing doGet won't make any difference.

Cheers,

Paul
I think you're right - I'm looking at equality in the context of the container (if names are equal) and equality in the context of the object (exactly equal in state).

It's almost like I could do with passing a Comparator-like object for equals to the Set to tell it how to perform the equals() method from its point of view.
16 years ago
Hi Paul,

Attributes & columns would matter if I was to try and implement something that diff'd the tables to identify differences.

eg. the database wouldn't care if two tables had different columns but the same name, but a comparison of the two tables would care that there were different columns.
16 years ago
Hi,

I'm trying to represent a relational database and its tables, so I have a class representing a database, and a class representating a table.

In the database class, there is a Set, containing Table objects, as I know that no two tables can have the same name within my database (ignoring more complex database structures for now...)

I can think of two equals() implementations that seem valid. I need to return true if two tables have the same name, so as to ensure no duplicate names in my collection, so that's one. However, if I do that, two table objects will be equal even if they contain different attributes and columns, so a direct comparison of two tables will be misleading.

Any thoughts on how to approach this best?

Many thanks,
16 years ago
Thanks for clearing that up for me Irina, I stared at that one for ages, just didn't see what was wrong with it!
Hi everyone, I cleared the SCJP exam for Java 5 with 88%.

I found that K&B covered everything I saw in the exam. I can also thoroughly recommend the Whizlabs preparation kit - it's very similar to the kind of questions I saw.

Good luck to everyone else!
16 years ago
Hi,

In the Generics and Collections chapter, Self Test Q16, the following method declaration is stated:

public static <E extends Number> List<E> process(List<E> nums)

Two answers are incorrect because they return an ArrayList, and not a List as declared - but ArrayList IS-A List, so I think that it is legal to return an ArrayList from this method.

The question is about getting the code to compile. Can someone clarify why it is illegal to return an ArrayList from this method please?

Many thanks,