Java SCWCD, OCWCD Test 1 - SCWCD Quiz | OCWCD Quiz | OCWCD Online Test
Finish Quiz
0 of 20 questions completed
Questions:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
Information
Java SCWCD, OCWCD Test 1 – SCWCD Quiz | OCWCD Quiz | OCWCD Online Test. Let’s play scwcd or ocwcd online test or quiz that will help you to clear your concepts and will prepare you for the interviews. , Free Java SCWCD/OCWCD Quiz, Online Java, online Test Quiz 1. Java SCWCD/OCWCD Quiz 1 Question and Answers 2024. Java online Test Quiz 1. Java SCWCD/OCWCD Quiz 1 Free Mock Test 2024. Java SCWCD/OCWCD Quiz 1 Question and Answers in PDF. The Java online mock test paper is free for all students. Spring Online is very useful for exam preparation and getting for Rank. Java SCWCD/OCWCD Quiz 1 Question and Answers in English. Java SCWCD/OCWCD Mock test for topic via SCWCD/OCWCD Mode. Here we are providing Java SCWCD/OCWCD Quiz in English Now Test your self for “SCWCD/OCWCD Online Quiz in English” Exam by using below quiz…
This paper has 20 questions.
Time allowed is 25 minutes.
The Java SCWCD/OCWCD Mock Test is Very helpful for all students. Now Scroll down below n click on “Start Quiz” or “Start Test” and Test yourself.
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading...
You must sign in or sign up to start the quiz.
You have to finish following quiz, to start this quiz:
Results
0 of 20 questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 points, (0)
Average score |
|
Your score |
|
Categories
- Not categorized 0%
Pos. | Name | Entered on | Points | Result |
---|---|---|---|---|
Table is loading | ||||
No data available | ||||
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- Answered
- Review
-
Question 1 of 20
1. Question
As a convenience feature, your web pages include an Ajax request every five minutes to a special servlet that monitors the age of the user’s session. The client-side JavaScript that handles the Ajax callback displays a message on the screen as the session ages. The Ajax call does NOT pass any cookies, but it passes the session ID in a request parameter called sessionID. In addition, assume that your webapp keeps a hashmap of session objects by the ID. Here is a partial implementation of this servlet: 10. public class SessionAgeServlet extends HttpServlet { 11. public void service(HttpServletRequest request, HttpServletResponse) throws IOException { 12. String sessionID = request.getParameter(“sessionID”); 13. HttpSession session = getSession(sessionID); 14. long age = // your code here 15. response.getWriter().print(age); 16. } … // more code here 47. } Which code snippet on line 14, will determine the age of the session?
Correct
Incorrect
-
Question 2 of 20
2. Question
The sl:shoppingList and sl:item tags output a shopping list to the response and are
used as follows:
11. <sl:shoppingList>
12. <sl:item name=”Bread” />
13. <sl:item name=”Milk” />
14. <sl:item name=”Eggs” />
15. </sl:shoppingList>
The tag handler for sl:shoppingList is ShoppingListTag and the tag handler for
sl:item is ItemSimpleTag. ShoppingListTag extends BodyTagSupport and
ItemSimpleTag extends SimpleTagSupport. Which is true?Correct
Incorrect
-
Question 3 of 20
3. Question
Given the definition of MyServlet:
11. public class MyServlet extends HttpServlet {
12. public void service(HttpServletRequest request,
13. HttpServletResponse response)
14. throws ServletException, IOException {
15. HttpSession session = request.getSession();
16 session.setAttribute(“myAttribute”,”myAttributeValue”);
17. session.invalidate();
18. response.getWriter().println(“value=” +
19. session.getAttribute(“myAttribute”));
20. }
21. }
What is the result when a request is sent to MyServlet?Correct
Incorrect
-
Question 4 of 20
4. Question
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:
201. private static final Set<String> USE_CASE_ATTRS;
202. static {
203. USE_CASE_ATTRS.add(“customerOID”);
204. USE_CASE_ATTRS.add(“custMgrBean”);
205. USE_CASE_ATTRS.add(“orderOID”);
206. USE_CASE_ATTRS.add(“orderMgrBean”);
207. }
Which code snippet deletes these attributes from the session object?Correct
Incorrect
-
Question 5 of 20
5. Question
Which three are true about the HttpServletRequestWrapper class?
Correct
Incorrect
-
Question 6 of 20
6. Question
Servlet A receives a request that it forwards to servlet B within another web application in the same web container. Servlet A needs to share data with servlet B and that data must not be visible to other servlets in A’s web application. In which object can the data that A shares with B be stored?
Correct
Incorrect
-
Question 7 of 20
7. Question
Which implicit object is used in a JSP page to retrieve values associated with <context-param> entries in the deployment descriptor?
Correct
Incorrect
-
Question 8 of 20
8. Question
You want to create a filter for your web application and your filter will implement javax.servlet.Filter. Which two statements are true?
Correct
Incorrect
-
Question 9 of 20
9. Question
Your web application requires the adding and deleting of many session attributes during a complex use case. A bug report has come in that indicates that an important session attribute is being deleted too soon and a NullPointerException is being thrown several interactions after the fact. You have decided to create a session event listener that will log when attributes are being deleted so you can track down when the attribute is erroneously being deleted. Which listener class will accomplish this debugging goal?
Correct
Incorrect
-
Question 10 of 20
10. Question
You have created a JSP that includes instance variables and a great deal of scriptlet code. Unfortunately, after extensive load testing, you have discovered several race conditions in your JSP scriptlet code. To fix these problems would require significant recoding, but you are already behind schedule. Which JSP code snippet can you use to resolve these concurrency problems?
Correct
Incorrect
-
Question 11 of 20
11. Question
A developer wants to make a name attribute available to all servlets associated with a particular user, across multiple requests from that user, from the same browser instance. Which two provide this capability from within a tag handler?
Correct
Incorrect
-
Question 12 of 20
12. Question
Given the JSP code:
<% request.setAttribute(“foo”, “bar”); %>
and the Classic tag handler code:
5. public int doStartTag() throws JspException {
6. // insert code here
7. // return int
8. }
Assume there are no other “foo” attributes in the web application. Which invocation
on the pageContext object, inserted at line 6, assigns “bar” to the variable x?Correct
Incorrect
-
Question 13 of 20
13. Question
A developer wants a web application to be notified when the application is about to be shut down. Which two actions are necessary to accomplish this goal?
Correct
Incorrect
-
Question 14 of 20
14. Question
A developer for the company web site has been told that users may turn off cookie support in their browsers. What must the developer do to ensure that these customers can still use the web application?
Correct
Incorrect
-
Question 15 of 20
15. Question
Which two statements about tag files are true?
Correct
Incorrect
-
Question 16 of 20
16. Question
Which statement is true about web container session management?
Correct
Incorrect
-
Question 17 of 20
17. Question
You need to store a Java long primitive attribute, called customerOID, into the session scope. Which two code snippets allow you to insert this value into the session?
Correct
Incorrect
-
Question 18 of 20
18. Question
If you want to use the Java EE platform’s built-in type of authentication that uses a custom HTML page for authentication, which two statements are true?
Correct
Incorrect
-
Question 19 of 20
19. Question
What is true about Java EE authentication mechanisms?
Correct
Incorrect
-
Question 20 of 20
20. Question
After a merger with another small business, your company has inherited a legacy WAR file but the original source files were lost. After reading the documentation of that web application, you discover that the WAR file contains a useful tag library that you want to reuse in your own webapp packaged as a WAR file. What do you need to do to reuse this tag library?
Correct
Incorrect