tiim fei

Greenhorn
+ Follow
since May 22, 2005
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 tiim fei

One week preparation. thanks for every body's help here.
I would say the certification exam questions are covered mostly by the JWebplus and other materials on the web. I don't have access to HFJS, (I'm not in US), so if anyone who have the same situation don't feel bad.
15 years ago
Is the scriptlet illegal for simple Tag even if the body-content is set to tagdependent ?

I understand that if the body-content set as JSP, then container will create a JspFragment object to us, while it not support scriptlet.
But what if the body-content set to tagdependent ? what whill happen ?

Thank you!
Resource in the WAR class directory or in any of the JAR files within the library directory may be accessed using J2SE sematics of getResource

This is one choice in a mock exam question, is this correct ?

The answer says yes, but is anyone could explain this for me ?

Thanks
Which of the following directives are applicable only to tag files? Select 3 correct options
a attribute
b variable
Valid only for tag files.
c page
d include
e import
No such directive.

General Comments
Only the following directives are valid for tag files:
taglib, include, tag, attribute, variable.


The answer is ABD , but I don't think include directive could only be used in tag files, it obviously could be used in a jsp page.
The question is a drag and drop , so I only write the choice and answer in text.

Can you explain why the reverse order is right , where the spec saying this ? Thank you
I guess this is because the mechanism of url-pattern match

I remember that ,container will match the url for longest possible matching
first, then try to match the .suffix pattern.

If this is true ,then the answer could be explained.
First a path Recipes/HopsList.do
the container go through the filters for Recipes/HopsList
find 1, 5, maching(The order is in dd)
then for suffix mapping , find 2 .

But this is my own assumption. Hope somebody to clarify this .
A.initialize filters defined in the web app dd.
B.instantiate listeners defined in the web dd
C.Initialize Servlets to load startup in the web app dd
D.The contextInitialized method is called on listeners implementing Servlet ContextListener which have been instantiated.

The given answer is C D B A
But I don't understand why. For example , if the D is before B , how that listener could be created ?
Any body give me a clue to this ?
I go through the spec 2.4
"Within an application marked as distributable, all requests that are part of a sessionmust be handled by one Java Virtual Machine1 (�JVM�) at a time. The container must be able to handle all objects placed into instances of the HttpSession class using the setAttribute or putValue methods appropriately. The following restrictions are imposed to meet these conditions:
� The container must accept objects that implement the Serializable interface.
� The container may choose to support storage of other designated objects in the HttpSession, such as references to Enterprise JavaBeans components and transactions.
� Migration of sessions will be handled by container-specific facilities."

I think D is correct. But for A, I think spec saying that only those objects which is set as attributes in HttpSession object should be guranteed to migrate correctly. So I don't think A is right. Also, I do think B and C are wrong.
One application was initially developed for a nondistributed env. The company recently purchased the Acme AppServer, which supports distributed HttpSession Objects. When deploying the app to the server, the deployer marks it as distributable in the dd to take advantage of this feature. Given this scenario, which two must be true ?
A. The J2EE web container must support migration of objects that implement Serializable.
B. The J2EE web container must use the native JVM Serialization mechanism for distributing HttpSession objects.
C. As per the spec, the j2ee web container ensures that distributed HttpSession objects will be stored in a database.
D. Storing references to EJB components in the HttpSession object might NOT be supported by J2EE web containers.

I remember that, those attribute of HttpSession object which implements Serializable interface would be guranteed to migrate correctly on different vm. But I don't know really all those choices provided here is correct or not.
a developer chooses to avoid using SingleThreadModel but wants to ensure that data is updated in a thread-safe manner.
which two can support this design goal ? (Choose two)
A. Store the data in a vocal variable
B. Store the data in an instance variable
c. Store the data in the HttpSession object
D. Store the data in the ServletContext object
E. Store the data in the ServletRequest object

The answer is A,D. I don't understand that. Could anybody help me ?