This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!

bengt hammarlund

Ranch Hand
+ Follow
since Oct 17, 2003
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 bengt hammarlund

That�s a good ideia. Thank you!

Any more ideias?
12 years ago
Hi guys,

I have a database table filled with configuration stuff. It�s a key/value table, that maps to a java.util.Map in runtime. The thing is, I can�t afford a database hit every time a servlet/EJB needs a configuration value. But I need the latest value of the configuration (if someone updates the table, I need the value updated eventually, that is, after 1 minute or so).

The application I�m developing is a 20 consumer/minute commerce site using BEA Portal 8.1.6. The application is clustered (distributed on 3 servers).

The configuration table would be updated up to 10 times a week.

I was thinking of a simple cache architecture:
1) A ContextListener that loads the config table and set the values on a singleton SystemConfiguration object. This object is stored as a application attribute that could be retrieved by any servlet/EJB of this application.
2) A page especially designed to maintain the system configuration (CRUD) would update the table and the SystemConfiguration instance with the updated values. That way the other servlets/EJBs whould already have the latest values.
3) To maintain the other machines updated (remember, it�s clustered) the ContextListener that initially populated the SystemConfiguration object would start a thread that would every minute update the SystemConfiguration with the last configuration data of the database table, in case of changes.

Does anyone see any problem here? Is there a thread problem in updating a Map object that is used by other objects? This object would be updated by only one thread at a time, but with no synchronization control over who�s reading the data. If the data consumer threads get old data sometimes, is not a big problem.

That�s it, any comments?
[ February 15, 2007: Message edited by: bengt hammarlund ]
12 years ago
I think there is a way to share a storage device. Any ideias?
Hi people,

I�m facing a real problem here. I need users to upload files (images, album photos and other types) into a application deployed into a clustered server (Weblogic Server - Portal 8.1.6).

The thing is that I want to save the files directly into the file system. But if I am in a cluster, the user is uploading the file(s) into one physical machine. Is that a decent way of replicating the files uploaded? Maybe Weblogic itself has a way, but I can�t seem to figure it out by it�s documentation.

Thank�s for any replies.

Originally posted by Sumithab Baskaran:

Just how important is reading through the specs? How did you manage to read through 700 pages and keep evrything in mind? Can I skip it and still afford to pass the exam?


Yes you can skip the specs. But the specs can get you a clearer picture of how some specific stuff works. Nothing that would really matter to the exam itself, but it would make a difference in your knowledge, and knowledge IS power.

I did read the specs especially on specific areas like JSPs and how servlets should be deployed.

[ October 24, 2005: Message edited by: bengt hammarlund ]
[ October 25, 2005: Message edited by: bengt hammarlund ]

Originally posted by rakesh mittal:
hi bengt

u had given a wide overview of scwcd exam pattern paper
can u do one more favour for us .
tell something about design pattern .
generally people say design pattern questions comes from
out of course objective, can u put some light on this fact.
and please tell how to study design patterns.

the design patterns questions are a little subtle, I got like 2 or 3 that I had to mark to come back to later. But I think that the HF book cover it gracefully. Don't forget to do as many mock exams as you can, especially on that.
thanks guys. I wanted to give a really good ideia of what to expect of the real thing, so the ones that did not took the exam yet could have an ideia of what is important (to the exam, not to real life development - but this is another discussion!)
Hi to all,

I passed today with 92%. It was just like I expected... not too easy nor too hard. I did 75% on head first mock SCWCD exam.

My main tip is, with Head first and some complementary mock exam (the free ones are ok)) and some reading of the specs, you should pass with 80%+ easy. But if you want 90%+ you should consider JWebPlus - I had at least 5 questions that wore 99% equal on the exam, plus a lot more that really helped.

I think that it's possible to do a perfect score on this exam, with some luck and a lot of study. I didn�t bother to revise my questions, if I did maybe I would score like 4% more.

My other scores are 96% SCJP and 90% SCJA (Associate).

- 2 questions on dynamic-attributes. (this tutorial is more than enough: link to tutorial)
- 5 or 6 on J2EE patterns
- 1 on http form POST / GET methods mapped to doPost / doGet servlet methods
- 3 questions with doService() overwritten
- 1 or 2 with init() overwritten, including one that throws an especial type of Exception (UnavailableException) that the container can try again to init later.
- 2 or 3 on jsp documents (xml)
- 3 or 4 on <jsp:useBean ...> tag - the main concept they tested wore scope (default page) and the fact that the body does NOT run if a bean with the same name already exists in the declared scope
- 2 on <jsp:import ...> - the concepts they tested wore scope and the fact that this is a run-time import
- 5 or more on other <jsp: ...> tags
- 3 on <c:set ...> two with var and one with target, all of them strait-forward if you have HF.
- 2 on where dtds should go (deployment)
- 3 on what is required when deploying using WAR files (on of them a little confusing, make sure you got it right).
- 3 on <login ...> deployment descriptor and related tags. Main concept tested: that you are doing the authentication part of J2EE security, and types of authentication, it's security strength etc.
- 5 or so on other security J2EE aspects and DD tags.
- 4 or 5 testing if you know what object (request, ServletContext or response) can give you request dispatchers, among other related objects).
- 4 or so on servlet and context init parameters, pretty strait-forward.
- 3 or so on filters, strait-forward.
- 1 or 2 on what happens with sessions after a explicit call on invalidate(), make sure you got it right.
- 5 or so on simple tags, all of them easy, 2 of them big ones (somewhat confusing, still easy, I got 100% on tags). Concepts tested: if you know that the main method is doTag() (instead of doStartTag), if you know how to map attributes from TLD to methods (javabean convention), if you know how to access parent tags and 1 question tested if you know how parent tags can access child tags (remember, there is NO getChildXXX() methods, the child tag must register itself with the parent tag invoking getParent() - the HF book covers this gracefully, as always. Other question tested if you know how to iterate and count how deep the tag is.
- 3 or 4 on listeners, very, very strait-forward.
- 2 or 3 on <%@ taglib...> directive (there's not much to ask about it anyway).
- 1 on exclusive tagfiles directives (make sure you know them, at least their names).
- 8 or so on EL, strait-forward.
- 1 on <el-ignored> DD tag (remember it's not <is-el-ignored>!!, don't confuse with the page directive isELIgnored attribute).
- 3 on el functions, one testing if you know that the method has to be public static, other testing if you know how the signature on the dtd should be, and other on how to call the function using EL
- 2 or 3 on how to encode URLs, and when to use encoding (button line is: always encode all URLs so in case there�s no cookies enabled, jsessionid request attribute gets on all URLs).
- 1 question on <c:url... > tag, pretty easy
- 1 or two questions on how to add a request/session etc parameter using request, request.getSession() etc
- 2 questions testing if you know that request.getParameterValues() returns Enumeration, not a List or an array.
- 2 questions testing if you know paramValues and headerValues EL implicit vars and how to access them (it�s not paramValues.1, it�s paramValues[1], and the first one is zero indexed).

- 3 or 4 easy drag and drop questions, one on listeners, other on <@ taglig ...> directive and other ones on DD tags.

That's about what I can remember write now.

Last good tip: this url gives the official objectives of the exam, I felt the exam pretty faithfull to this objectives, so keep them (especially on the last couple of days before the real thing) and make sure you fell confortable with all objectives.

Good luck to all!!

[ October 17, 2005: Message edited by: bengt hammarlund ]
[ October 17, 2005: Message edited by: bengt hammarlund ]
that's because the ServletContext only have information about the context, and do not have any ideia of the request's path. But this info (the path of the request), it's necessary for supporting the relative not-back-slash String path, that the dispatcher ServletRequest gives you support.
I've done all the 7 mock exams on JWebPlus (Enthuware) and i got 76% on all but the first (56%). Am I ready?

PS.: it's really strange, but I realy got exactly 76% on 6 of 7 exams!

Thanks for any opinions.
I personally think that it's proposital. It's a way to keep the reader alert, to force us to think and prepare to be ready to answer questions about something we didn't studied yet, a scenario that probably will happen in the real exam.
So it's interesting to be a little more prepared to think, and don't desperate on the real thing. It's like a psychological preparation, instead of only a technical one (I think that is what makes this a great book).

Good luck on the exam and I hope the authors reply this thread, to clarify if I'm right or just plain crazy.
go to prometric site, login and get to the "Candidate History".

The Confirmation Number is the "Registration ID" right field value.

Good luck to all. I can't find my score, probably later or tomorrow. I can't complain, I got the exam for free
13 years ago
I think that you're wrong. You must synchronize on HttpSession. That's because it's the only object that you really have bound to a client and accessible throughout various requests (this is called scope). Any other object you would have to use the HttpSession to get it, and then synchronize on it, but think about it - you already are accessing the HttpSession, unsynchronized.
supose you want to guarantee that an attribute comes from the request, even if the page scope have an attribute with the same name... you need requestScope for that.

They are meant to give the developer control from what scope he/she wants to get the attribute value from.

If you use only the name of the attribute, it will be searched in all scopes (from page down to application - correct me if I'm wrong!) and the value returned whould be of the first with the name you gave.

Hope that clarifies.