Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp

ak pillai

author
+ Follow
since Feb 11, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 ak pillai

Good to hear. I was born in Srilanka and interested to know if there is any website for the Srilankan Java community?
13 years ago
Yes as ulf said by deafault no session is created but you can create a session by


<%@ page session="true">
13 years ago
Can you use "database triggers" on your Bills Of Materials (BOM) related table to fire on any insert/update/delete to immediately update your temp tables and also have a "wait" flag column in your temp table to make sure that updating the same item of your temp table and accessing the report data for the same item do not happen concurrently resulting in stale data being read by your report. If the wait flag for a particular item is set to "true" then implement a retry strategy (re-try after 30 seconds etc) or send a warning message indicating that BOM is being exploded for the item XYZ and try later.
13 years ago
Something like ....


13 years ago
You need to use JavaScript on yyour client tier.




If you want a server-side solution to prevent duplicate submits then should try and use Session token synchronization pattern.
13 years ago
JSP
Why not use some hidden fields to distinguish where the request came from along with sendRedirect.
13 years ago
try: http://www.jguru.com/faq/view.jsp?EID=10646


[ July 24, 2006: Message edited by: ak pillai ]
13 years ago
You can't alter the request parameters, just read them. If you could there would be a setParameter() method. You save the altered values as the request attributes and use your saved request attributes in your servlet.Parameters and attributes do not share a name space so a parameter named "name" and an attribute keyed "name" are distinct.
13 years ago
Following sites may help


http://www.jroller.com/page/fate?entry=good_vs_evil

http://www.oreillynet.com/cs/user/view/cs_msg/20299
13 years ago
Also can try "instanceOf" operator prior to casting. Care should be taken not to use "instanceOf" operator in large loops etc since it can adversely affect performance.

If you use reflection remember to cache reflected values otherwise it can adversely affect performance.
13 years ago
I guess they mean the same thing. Unless some one can clarify otherwise.


The Java Garbage Collector runs in a low priority thread and it cannot be forced to execute. So in your code you can provide clean up methods to make sure that your objects are eligible for garbage collection once you are finished with those objects. This does not mean that your memory will be immediately released.


Your memory would not be released until the Garbage Collection starts to run to free up your memory.
13 years ago
== is a shallow comparison, which only compares the identity.


The == returns true, if the variable reference points to the same object in memory. This is a �shallow comparison�.


equals() method is a deep comparison whick makes use of equals() method to make sure they are logically equal.

The equals() - returns the results of running the equals() method of a user supplied class, which compares the attribute values. The equals() method provides �deep comparison� by checking if two objects are logically equal as opposed to the shallow comparison provided by the operator ==.

If equals() method does not exist in a user supplied class then the inherited Object class's equals() method is run which evaluates if the references point to the same object in memory. The object.equals() works just like the "==" operator (i.e shallow comparison).

Overriding the Object class may seem simple but there are many ways to get it wrong, and consequence can be unpredictable behaviour.
[ July 18, 2006: Message edited by: ak pillai ]
13 years ago
Create a Class called Config and store your values as key/value pairs on a HashMap within your config class and provide accessor methods read relevant data.
13 years ago


My gripe is with presenting lists of technical questions for people to cram (which the review indicates is what this book is about).



It depends on how you view it and how the readers use it:

-- It might be a cram for some but it will be a great refresher/quick reference guide for many (Java/J2EE technology is very vast and you do not work with all the things all the times). Also one can attend his/her interviews with confidence.

-- I have seen some good Java/J2EE professionals who are excellent when it comes to coding but find it a bit difficult to relate that practical knowledge well in interviews, to their peers, subordinates,seniors etc.

-- Questions and Answers approach with examples and diagrams provide a different perspective to learning and pro-active learners will find it useful in understanding the core concepts.

-- It also helps junior developers to understand the core concepts and key areas relating to Java/J2EE development and streamline their learning process without having to get confused or worried about all the technical jargons and myriad of related technologies and where they all fit in. Also depending on the level of knowledge, one can easiliy find additional information on the web once you know the key terms to search for from the book. Some might want to know more about JNDI and others might want to know more about Transaction Management, or Threading issues etc. So the book has been categorized by key areas like threading, transaction management, memory issues etc and technologies like Java. J2EE, JDBC, JNDI XML, etc.


In my view, If you are hiring junior developers or entry level positions, I would rather hire a junior developer who is intelligent and pro-active enough to have some basic idea on Java/J2EE basics.

If some one is cramming for a senior level position then as was suggested by Bert Bates, you need to filter that through a proper interviewing process. I am currently working for an Investment Bank, which has a very thorough recruitment process. This book does not provide one line answers to the questions as many of the Job Interview sites do. This book provides concise and clear explanations with examples, diagrams etc. It also covers wide range of Java/J2EE related topics and depending on one's level of seniority, one can pick and choose his/her topic of interest and if required can find additional information on the web by typing the key terms.

[ July 16, 2006: Message edited by: ak pillai ]
[ July 17, 2006: Message edited by: ak pillai ]
13 years ago