Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Zakaria Haque

Ranch Hand
+ Follow
since Jan 02, 2002
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 Zakaria Haque

Originally posted by Angela D'souza:
How to find out local java groups in LA city?
Thanks,
Angela



www.lajug.org
There is also a study group within the jug which you may find interesting.
18 years ago

Originally posted by Gregg Bolinger:

How the heck do you know what values can be used for the key and value Strings?


you just don't know URLConnection is an abstraction for using URL with ANY protocol. At this level of abstration there is simply no limitation on which values you can use.


Does anyone know why Sun does this,


In this case the API docs does not say anything, bacause it can not. URLConnection is way too generic to say anything about the legitimate key-value pairs.


or know where I can get information regarding such methods?


The rfcs provided in other responses are great resources for HTTP. For other schemes, you need to find necessary documentation (not necessarily the standard library docs) or just post your question here.
Hope it clarifies.

Originally posted by Jim Yingst:
"all the rooms in this buiding are unlocked, but not any of the outside doors." If you can't get in the building, it doesn't matter whether the inner doors are locked or not.


Actually it is more like all the rooms in this buiding are unlocked, "but not any of the outside doors or you can come thru the ventalitors" if a public inteface extends the package level interface, then the former will contain the methods define in the latter. :roll:
18 years ago
fast java
18 years ago
gc clears soft or weak references before they are enqued, but phantom references are never cleared by gc. you have to get the object from the associated reference queue and call the clear method yourself. The benefit is, with PhantomReference you can do some fine-grain cleanup before the object is reclaimed by gc, which you can not do with other references(since they are alreasy cleared). Note that, the referent object can be finalized(but not reclaimed) before the phantom reference is enqueued.
If you are working with references, watch that gc may not call the clear method of the API to clear a object. That is, if you subclass any of the reference classes and override the clear method, dont expect it to execute when the gc is clearing the object.
Feel free to ask if this is not clear.
18 years ago
good job, keep it up dude.
18 years ago
I pretty much agree with Cindy.
I would consider morality highly correlated with society and time period. West has affected much of the rest of the world in last 500 years, and the western values has been gradually pervading these cultures. Today, in a world highly affected by typical western values, adultery might be considered bad. But this is not necessarily true in all socities and all time period. Even today in some socities adultery is the norm. The further you go back in time, you would find a world with more divarsified cultures and morality.
Society itself is not a homogeneous entity as well. We have classes and those class can deviate from the norm of other classes. Is adultery considered equally bad among the extreme poors and extreme riches?
18 years ago
Very interesting question. From HashMap.put(Object,Object) source in 1.3, it looks like multiple threads can actually put multiple entries in the hashtable with same key !!! Here is the code that adds new entry to the hashtable if there is no entry with the same key already esisting
----
Entry e = new Entry(hash, key, value, tab[index]);
tab[index] = e;
count++;
return null;
----
If there os no entry in the hashtable with the same key and one thread executes upto before this block, and then the other thread starts executing, you will end up with to Entry instances with the same key. !!
Please prove me wrong.
18 years ago

Originally posted by David O'Meara:
I'm pretty sure you can't jsp:include or forward to a servlet, only between JSPs.


I think you are confusing static and dynamic includes. Since jsp:include uses RequestDispatcher( the spec does not mandate using RequestDiaptcher, so teh jsp engine MAY use some proprietary mechanism) for dynamic contents, you can include pretty much anything exsiting in the webapp domain.
18 years ago
JSP
cool score, congratulations.
18 years ago
Congrats man, great job.
18 years ago
Some of the questions were tricky, some were ambigious. But overall, 61% is too easy for a passing score.
Here are the resources I used:
More servlets and JSP by Marty Hall
- The book contains much more information than you need. Very informative.
API spec(javadoc):
- Indispensable.
Servlet 2.3 and JSP 1.2 specs
- I used it a lot. But for the exam Marty's book is probably sufficient.
Marty Hall's exam reviews: http://courses.coreservlets.com/Course-Materials/15-Web-Component-Certification.pdf
- Great for the night before.
Miftah Khan's Note - http://www.javaranch.com/carl/scwcd/servlet_study_guide.rtf
- Great for the night before.
18 years ago

Originally posted by pradeep bhat:
yes.
ServetContext otherCtx = getServletContext().getContext("anotherContext");
RequestDispatcher rd = otherCtx.getRequestDispatcher("jspor servlet");
rd.forward() ;


ServletContext.getContext("anotherContext") may return null for security reasons depending on the appserver. So, this may not work in all cases.
you have to specify the scope as something other than the default page. If you need the the bean only to serve that particular request, give it a request scope, it will bind the bean with the request object with the "id" as key.
18 years ago
JSP

Originally posted by David O'Meara:

Otherwise visiting a web page could result in people writing viruses, overwriting properties, or even have Microsoft detect a Linux operating system and overwrite it with Windows


... and charge the webmaster for licence and consulting fees
18 years ago