Stella Kim

+ Follow
since Jan 18, 2007
Merit badge: grant badges
For More
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 Stella Kim

I just passed SCWCD today with 92%.
I just read HeadFirst Servlets & JSP book and some free mock exam.
I think HFSJ book is so awesome and perfect for this exam.
17 years ago
got SCJP 1.4 (98%) and SCWCD (92%)...
And I want to go for the next...
Is this SCBCD is right one ?
Or, SCWJWS is also one that I can go for ...
Anyone can help me ?
I passed exam today with 92%.
I think HF book is the best book.
I just read HF three times and did some free mock exam.
But, for me, HF book was the one. If you read the book understand thoroughly, then nobody would have problems to pass.

Thank you all here, especially who answered to my questions ^^
HF book on page 789, the mock exam 54)

Given the library descriptor located at /mywebapp/WEB-INF/tlds/mytags.tld, which would be the correct taglib directive? Asume mywebapp is the web application root and that there are no <taglib> tags in the deployment descriptor.

a) <%@ taglib uri = "/mytags.tld" prefix = "my" %>
b) <%@ taglib uri = "/tlds/mytags.tld" prefix = "my" %>
c) <%@ taglib uri = "/WEB-INF/tlds/mytags.tld" prefix = "my" %>
d) <%@ taglib uri = "/mywebapp/WEB-INF/tlds/mytags.tld" prefix = "my" %>

Book says the correct answer is c), and the book explains that if you don�t put <taglib> in DD, the uri in a taglib directive in JSP must be a full path relative to the application root.

I am confused. I though the correct answers are all of them (as long as the TLD file has corresponding <uri> )...
The new (JSP2.0) way is the Container automatically maps a taglib uri to a TLD and you don't have to specify <taglib> in DD.

Anyone can explain ?
you are right Ali,
I tried and it does print "new"..
Thanks Ali,
I know it needs quotes in ${requestScope['b']} like this.

But, I was just curios what will happen if I don't put quotes inside the brackets with EL implicit object
and I thought it might try to the attribute bound under that name and substitue tha value of that attribute,
as it does in ${myMap[b]}.
[ January 24, 2007: Message edited by: Stella Kim ]
Oh, sorry,
I didn't read carefully.

Thank you all
Anyone can confirm this ?

Filter -- then Listener ?


Listener -- then Filter ?
Let's say :

java.util.Map myMap = new java.util.HashMap( );
myMap.put("a", "b");
myMap.put("b", "c");
myMap.put("c", "d");
setAttribute("myMap", myMap);

setAttribute("b", "c");

${myMap[b]} ---- prints d (as I expected)
${requestScope[b]} ---- prints nothing ...why?
Anyone can explain the underlying process about this?
(requestScope is just another map with key and value, then why
requestScope[b] cannot find the attribute value bound to b, which is "c" here)

[ January 24, 2007: Message edited by: Stella Kim ]
[ January 24, 2007: Message edited by: Stella Kim ]
In which two locations can library dependencies be defiend for a Web application ?

a) the web application deplyment descriptor
b) the /META-INF/dependencies.xml file
c) the /META-INF/MANIFEST.MF manifest file
D) the /META-INF/MANIFEST.MF manifest of JAR in the web application classpath.

I can see c) is one of the correct answer.
What's the other one ?
Anyone can help ?
..I think there is no speicific default body-content for custom tags. It just depends on how you specify the <body-content> element in TLD.
For custom tag(simple tag, custom tag), the <body-content> is required, (mandatory) in TLD.

For tag file, it has a default value of 'body-content' which is 'scriptless'. The tag file 'body-content'is not defined in TLD, rather, it's defined inside the tag file itself using <%@ tag > directive, for example, <%@tag body-content="tagdepent" %>.

For a custom tag, the <body-content> element inside the TLD is mandatory, but a Tag File doesn't have to declare <body-content> if the default (scriptless) is acceptable. As with Simple tags, the Tag File body cannot be scripting either as you mentioned.
I think the order is :
FilterOne --> FilterThree --> FilterFour
sorry, i mistyped by deleting my reply post..

Stella, so according to your first line all implicit objects are Maps and anything to the left of the dot operator is a Map.
Except 'pageContext', all EL implicit objects are Map, so you can use it to the left of the dot operator.
You can also use Bean to the left of the dot operator, like I wrote in the deleted reply post.


setAttribute("bean", theBeanObject) --> ${bean.beanProperty}
setAttribute("map", theMapObject) --> ${map.theKey}

Also with EL implicit object;
[ January 23, 2007: Message edited by: Stella Kim ]
My understanding is:
'Service Locator' is to look up JNDI to locate the registered remote Model and Bean. One of the benefit of 'Service Locator' is minimizing the impact on the web tier when remote component change LOCATIONS or CONTAINERS.

And use 'Business Delegate' to interact indirectly with the remote Model and Bean. The goal of 'Business Delegate' is to minimize the coupling between presentaion-tier client and the business service by hiding the underlying implementation details of the service, and handles the exception from the business services...
As an example, the Business Delegate can be used to perform any retry or recovery in case the business service fails without impacting the client.

please correct me if anything wrong..
[ January 23, 2007: Message edited by: Stella Kim ]
When the web-application is distributed across TWO VMs :

Everything except the 'HttpSession' is duplicated on the other VM.
'HttpSession' objects(including their attributes) 'move' from one VM to another.
'HttpSession' live in only ONE place at any given moment, so same session ID for a given web app will NEVER appear in two VMs at the same time.

<HF book on page 255>