Win a copy of Spark in Action this week in the Open Source Projects forum!

Hasnain Javed Khan

Ranch Hand
+ Follow
since Nov 23, 2007
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 Hasnain Javed Khan

Hello all,

I have to run a utility on Ubuntu but that utility can be run only under a specific user group.I am using the ProcessBuilder class to run that utility but I don't know how to run the Java program (or the thread) under that specific user

Example: the utility dbmaint (Pervasive SQL) can be run only if you are under the user group "psql".

I would like to run dbmaint from my java program as a psql user. Any pointers code snippets would be really helpful

Thanks in advance.

Kind Regards.
Hasnain.
9 years ago

Hasnain Javed Khan wrote:Hello all,

Just Passed SCWCD exam with 94 %. Firstly, hats down before the authors of HFSJ. Thanks to All the ranchers who answered my doubts and answered my questions.

I will update my post with the tips and preparation schedule that I followed when I get home.

Kind Regards.
Hasnain Javed



Thank you so much guys.

As promised, here is how I prepared and some tips.

Read HFSJ once along with the specification.

Did not do extensive coding but enough to clear doubts.

Read HFSJ second time along with the specification and while in the middle of the second iteration, God blessed me with a Baby Boy.

Studied the API (Fredric Esnault's API notes),web.xml elements and tld file elements.

Took Marcus Green Mock Exam, JavaBeat's and Nicko's mock questions. The sequence allowed me to identify my weak/gray areas. Although some questions in the mentioned sequence had wrong questions but it did help me in assessing my understanding of the concepts.

Took the Mock Exam at the end of HFSJ and scored 78.3 %. Although the exam at the end of HFSJ was harder than the real Exam.

Bought Enthuware's JWeb+ which helped a lot with the concepts.

And finally, gave the exam.The exam was not that hard but be ready for surprises.Make sure you study the web.xml elements and the API methods even if they are not mentioned in HFSJ. Don't let questions with big descriptions throw you off. There is no need to panic. Just read carefully. The simplest of concepts will make you scratch your head.So don'y under estimate simple concepts.

What Am I going to do next, Have no idea. SCBCD was in the queue but Spring Framework (which I'm already using) is dominant over EJBs. Not interested in Web Services but thinking of SCJD and finally will go for SCEA exam. I don't know how EJBs will turn out and what weight will SCBCD have in the future.But if they are getting recognition, then I'll go for SCBCD as well. Any suggestions are welcome and will be highly appreciated.

Good Luck to all future SCWCD exam takers.

Kind Regards.
Hasnain Javed Khan.
10 years ago
Hello all,

Just Passed SCWCD exam with 94 %. Firstly, hats down before the authors of HFSJ. Thanks to All the ranchers who answered my doubts and answered my questions.

I will update my post with the tips and preparation schedule that I followed when I get home.

Kind Regards.
Hasnain Javed
10 years ago
Hello Ankit.

Ankit Garg wrote: The book is talking about HttpSession object not ServletContext...



Yes I know the book is talking about HttpSession.What I'm talking about is the ServletContext.


The above quote is confusing me. The same Servlet Context on VM 1 will be shifted to VM 2 or there already is a Servlet Context in VM 2 ?



In the beginning of the sentence


Note: everything is duplicated in the second server



If there are two ServletContext instances in two VMs, what gets duplicated regarding the ServletContext,ServletConfig etc?

Kind Regards.
Hasnain Javed.

Hello All,

I seem to be having lots of problems in solving questions regarding distributed web applications and servlet context, servlet config etc.

Following is quoted from HFSJ


There is one ServletContext per VM.
There is one ServletConfig per servlet, per VM.



As far as I understood, if there are two JVMs, there will be two servlet contexts, two servlet configs and two instances of the same servlet per VM in total ? Am I misunderstanding the concept or missing some information ?

On page 257 of HFSJ (the two diagrams)


Note: everything is duplicated in the second server EXCEPT the HttpSession objects! Sessions live in only ONE place at any given moment. The same session ID for a given web app will NEVER appear in two VMs at the same time.



The above quote is confusing me. The same Servlet Context on VM 1 will be shifted to VM 2 or there already is a Servlet Context in VM 2 ?

Hope my question is clear.

Kind Regards.
Hasnain Javed.

Ankit Garg wrote:

For JSP:
Can Have: template text,EL,custom and standard actions.
Can not have : ? (or can have anything)


For body content of type JSP, the body can have anything that can go in a normal JSP i.e. template text,EL,custom, standard actions, scriptlets, scripting expressions and declarations...



Thanks Ankit for the clarification.

Kind Regards.
Hasnain.
Hello All,

I have some confusion when the body content value is assigned JSP in tld file for a tag's body.What can and can not go inside the tag body when body-content is JSP. Just to make my question clear

For scriptless:
Can Have: template text,EL,custom and standard actions.
Can not have : scriptlets, scripting expressions, and declarations.

For JSP:
Can Have: template text,EL,custom and standard actions.
Can not have : ? (or can have anything)

Kindly correct me if I'm wrong for the above statements.

Kind Regards.
Hasnain Javed.

Christophe Verré wrote:

My heart is broken


No no, only your wallet might be



lolxxxxxxx

Vijitha Kumara wrote:

Hasnain Javed Khan wrote:This is something I did not like about HFSJ. There are many such questions that HFSJ does not give any details about in the chapters and asks such questions at the end of the chapters..


That's why authors specifically mentioned to read the specs for more details



Not necessarily


You should have a copy of the specs, although you do not need them in order to
pass the exam



Kind Regards.
Hasnain.

Hi,

The following is quoted from the Servlet Spec 2.4 Chapter SRV 9 Web Applications.


SRV.9.7.2 Web Application Class Loader
The class loader that a container uses to load a servlet in a WAR must allow the
developer to load any resources contained in library JARs within the WAR
following normal J2SE semantics using getResource
. As described in the J2EE
license agreement, servlet containers that are not part of a J2EE product should not
allow the application to override J2SE platform classes, such as those in the java.*
and javax.* namespaces, that J2SE does not allow to be modified. Also, servlet
containers that are part of a J2EE product should not allow the application to
override J2SE or J2EE platform classes, such as those in java.* and javax.*
namespaces, that either J2SE or J2EE do not allow to be modified. The container
should not allow applications to override or access the container’s implementation
classes
. It is recommended also that the application class loader be implemented so
that classes and resources packaged within the WAR are loaded in preference to
classes and resources residing in container-wide library JARs.



This is something I did not like about HFSJ. There are many such questions that HFSJ does not give any details about in the chapters and asks such questions at the end of the chapters .

Hope this helps.

Kind Regards.
Hasnain.
Hi,


What is then the goal / focus of the NEW 084 exam to upgrade the certification? Just a bit of marketing?



Well.... the upgrade exam tests on those changes/addition in the specification that were not present in the older version of the specification (guys correct me if I'm wrong).

I don't know if you had a look the following thread.

About-SCWCD-exam

Hope that helped and hope I did understand what you asked for.
Kind Regards.
Hasnain.
Hi Peter,

These Links might help

SCWCDLinks
SCWCDFaq

Kind Regards.
Hasnain.

avi sinha wrote:
here in the first case that is without quotes, container starts looking for an attribute in all the scopes and gets the value MyName.
hence and there is no any attribute in the sessionScope named MyName hence nothing is printed.



It was so trivial (Thanks to HFSJ => There are no Dumb Questions). It implies I need to give my brain some rest
Thanks Avi .

Kind Regards.
Hasnain.
Hello All.
I have a question that is confusing me regarding EL. The following line is taken from HFSJ 2nd Edition


If there are no quotes inside the brackets, the Container evaluates what’s inside the brackets by searching for an attribute bound under that name, and substitutes the value of the attribute



Here is what I tried in a JSP



No output when using " [] " but got MyName printed when using "." .
Can anyone kindly explain why "name" inside [] cannot be resolved by the container since the attribute "name" is present in session scope ? Am I missing some point/information ?
I'm using tomcat 6.16.

Kind regards.
Hasnain Javed.