SUN Sun Certified Web Component Developer for J2EE 5 - 310-083 Exam Practice Test
The tl:taskList and tl:task tags output a set of tasks to the response and are used as follows:
1 1. <tl:taskList>
1 2. <tl:task name="Mow the lawn" />
1 3. <tl:task name="Feed the dog" />
1 4. <tl:task name="Do the laundry" />
1 5. </tl:taskList>
The tl:task tag supplies information about a single task while the tl:taskList tag does the final output. The tag handler for tl:taskList is TaskListTag. The tag handler for tl:task is
TaskTag. Both tag handlers extend BodyTagSupport.
Which allows the tl:taskList tag to get the task names from its nested tl:task children?
1 1. <tl:taskList>
1 2. <tl:task name="Mow the lawn" />
1 3. <tl:task name="Feed the dog" />
1 4. <tl:task name="Do the laundry" />
1 5. </tl:taskList>
The tl:task tag supplies information about a single task while the tl:taskList tag does the final output. The tag handler for tl:taskList is TaskListTag. The tag handler for tl:task is
TaskTag. Both tag handlers extend BodyTagSupport.
Which allows the tl:taskList tag to get the task names from its nested tl:task children?
Correct Answer: D
What is true about Java EE authentication mechanisms?
Correct Answer: B
You have a use case in your web application that adds several session-scoped attributes.
At the end of the use case, one of these objects, the manager attribute, is removed and then it needs to decide which of the other session-scoped attributes to remove.
How can this goal be accomplished?
At the end of the use case, one of these objects, the manager attribute, is removed and then it needs to decide which of the other session-scoped attributes to remove.
How can this goal be accomplished?
Correct Answer: B
One of the use cases in your web application uses many session-scoped attributes. At the end of the use case, you want to clear out this set of attributes from the session object.
Assume that this static variable holds this set of attribute names:
2 01. private static final Set<String> USE_CASE_ATTRS;
2 02. static {
2 03. USE_CASE_ATTRS.add("customerOID");
2 04. USE_CASE_ATTRS.add("custMgrBean");
2 05. USE_CASE_ATTRS.add("orderOID");
2 06. USE_CASE_ATTRS.add("orderMgrBean");
207. }
Which code snippet deletes these attributes from the session object?
Assume that this static variable holds this set of attribute names:
2 01. private static final Set<String> USE_CASE_ATTRS;
2 02. static {
2 03. USE_CASE_ATTRS.add("customerOID");
2 04. USE_CASE_ATTRS.add("custMgrBean");
2 05. USE_CASE_ATTRS.add("orderOID");
2 06. USE_CASE_ATTRS.add("orderMgrBean");
207. }
Which code snippet deletes these attributes from the session object?
Correct Answer: C
Click the Exhibit button.
The Appliance class is a Singleton that loads a set of properties into a Map from an external data source. Assume:
An instance of the Appliance class exists in the application-scoped attribute, appl
The appliance object includes the name property that maps to the value Cobia
The request-scoped attribute, prop, has the value name.
Which two EL code snippets will display the string Cobia? (Choose two.)

The Appliance class is a Singleton that loads a set of properties into a Map from an external data source. Assume:
An instance of the Appliance class exists in the application-scoped attribute, appl
The appliance object includes the name property that maps to the value Cobia
The request-scoped attribute, prop, has the value name.
Which two EL code snippets will display the string Cobia? (Choose two.)

Correct Answer: B,F
You are building a web application with a scheduling component. On the JSP, you need to show the current date, the date of the previous week, and the date of the next week. To help you present this information, you have created the following EL functions in the 'd' namespace:
name: curDate; signature: java.util.Date currentDate()
name: addWeek; signature: java.util.Date addWeek(java.util.Date, int)
name: dateString; signature: java.util.String getDateString(java.util.Date)
Which EL code snippet will generate the string for the previous week?
name: curDate; signature: java.util.Date currentDate()
name: addWeek; signature: java.util.Date addWeek(java.util.Date, int)
name: dateString; signature: java.util.String getDateString(java.util.Date)
Which EL code snippet will generate the string for the previous week?
Correct Answer: D
Given a portion of a valid Java EE web application's directory structure:
MyApp
|
|-- File1.html
|
|-- Directory1
| |-- File2.html |
|-- META-INF
|-- File3.html
You want to know whether File1.html, File2.html, and/or File3.html will be directly accessible by your web client's browsers.
Which statement is true?
MyApp
|
|-- File1.html
|
|-- Directory1
| |-- File2.html |
|-- META-INF
|-- File3.html
You want to know whether File1.html, File2.html, and/or File3.html will be directly accessible by your web client's browsers.
Which statement is true?
Correct Answer: A
You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to an ArrayList object. Which two JSP code snippets can you use to import these list types? (Choose two.)
Correct Answer: A,C
Given the security constraint in a DD:
1 01. <security-constraint>
1 02. <web-resource-collection>
1 03. <web-resource-name>Foo</web-resource-name>
1 04. <url-pattern>/Bar/Baz/*</url-pattern>
1 05. <http-method>POST</http-method>
1 06. </web-resource-collection>
1 07. <auth-constraint>
1 08. <role-name>DEVELOPER</role-name>
1 09. </auth-constraint>
1 10. </security-constraint>
And given that "MANAGER" is a valid role-name, which four are true for this security constraint? (Choose four.)
1 01. <security-constraint>
1 02. <web-resource-collection>
1 03. <web-resource-name>Foo</web-resource-name>
1 04. <url-pattern>/Bar/Baz/*</url-pattern>
1 05. <http-method>POST</http-method>
1 06. </web-resource-collection>
1 07. <auth-constraint>
1 08. <role-name>DEVELOPER</role-name>
1 09. </auth-constraint>
1 10. </security-constraint>
And given that "MANAGER" is a valid role-name, which four are true for this security constraint? (Choose four.)
Correct Answer: A,B,C,D
In a JSP-centric shopping cart application, you need to move a client's home address of the Customer object into the shipping address of the Order object. The address data is stored in a value object class called Address with properties for: street address, city, province, country, and postal code. Which two JSP code snippets can be used to accomplish this goal? (Choose two.)
Correct Answer: A,D
Which retrieves all cookies sent in a given HttpServletRequest request?
Correct Answer: D
Assume that a news tag library contains the tags lookup and item:
lookup Retrieves the latest news headlines and executes the tag body once for each headline. Exposes a NESTED page-scoped attribute called headline of type com.example.Headline containing details for that headline.
item Outputs the HTML for a single news headline. Accepts an attribute info of type com.example.Headline containing details for the headline to be rendered.Which snippet of JSP code returns the latest news headlines in an HTML table, one per row?
lookup Retrieves the latest news headlines and executes the tag body once for each headline. Exposes a NESTED page-scoped attribute called headline of type com.example.Headline containing details for that headline.
item Outputs the HTML for a single news headline. Accepts an attribute info of type com.example.Headline containing details for the headline to be rendered.Which snippet of JSP code returns the latest news headlines in an HTML table, one per row?
Correct Answer: A