Oracle Java EE 6 Web Component Developer Certified Expert (1Z0-899) Free Practice Test
Question 1
Which method must be used to encode a URL passed as an argument to HttpServletResponse. sendRedirect when using URL rewriting for session tracking?
Correct Answer: C
Question 2
You are building a dating web site. The client's date of birth is collected along with lots of other information.
The Person class has a derived method, getAge() :int, which returns the person's age calculated from the date of birth and today's date. In one of your JSPs you need to print a special message to clients within the age group of 25 through 35.
Which two EL code snippets will return true for this condition? (Choose two.)
The Person class has a derived method, getAge() :int, which returns the person's age calculated from the date of birth and today's date. In one of your JSPs you need to print a special message to clients within the age group of 25 through 35.
Which two EL code snippets will return true for this condition? (Choose two.)
Correct Answer: B,D
Question 3
Given the JavaBean class:
public class MyBean {
private Boolean roasted = false;
public MyBean () {}
public Boolean isRoasted () { returned roasted }
public void setRoasted (Boolean roasted) { this.roasted = roasted; ]
}
Assume a controller has created an instance of this bean, called setRoasted (true), and inserted the bean into the application scope using the name "myBean".
A JSP contains these two tags:
<jsp: useBean id = "aBean" class = "MyBean" scope = "page" \ />
<jsp: getProprty name = "aBean" property = "roasted" \ />
Which is true?
public class MyBean {
private Boolean roasted = false;
public MyBean () {}
public Boolean isRoasted () { returned roasted }
public void setRoasted (Boolean roasted) { this.roasted = roasted; ]
}
Assume a controller has created an instance of this bean, called setRoasted (true), and inserted the bean into the application scope using the name "myBean".
A JSP contains these two tags:
<jsp: useBean id = "aBean" class = "MyBean" scope = "page" \ />
<jsp: getProprty name = "aBean" property = "roasted" \ />
Which is true?
Correct Answer: E
Question 4
To take advantage of the capabilities of modern browsers that use web standards, such as XHTML and CSS, your web application is being converted from simple JSP pages to JSP Document format. However, one of your JSPs, /scripts/screenFunctions.jsp, generates a JavaScript file. This file is included in several web forms to create screen-specific validation functions and are included in these pages with the following statement:

Which JSP code snippet declares that this JSP Document is a JavaScript file?

Which JSP code snippet declares that this JSP Document is a JavaScript file?
Correct Answer: D
Question 5
You are working on a JSP that is intended to inform users about critical errors in the system. The JSP code is attempting to access the exception that represents the cause of the problem, but your IDE is telling you that the variable does not exist. What should you do to address this problem?
Correct Answer: A
Explanation: Only visible for TestSimulate members. You can sign-up / login (it's free).
Question 6
A popular Ajax framework and its companion widget library contain several hundreds of files of different types (.js, .ess, .html). Your company has mandated that all its web applications use only specific versions of this framework approved by IT and repackaged internally as jar files. Furthermore, web applications should only include the entire jar, without subsetting or modification.
Where should the framework's files be placed inside a jar file to enable this kind of reuse?
Where should the framework's files be placed inside a jar file to enable this kind of reuse?
Correct Answer: D
Question 7
Users of your web application have requested that they should be able to set the duration of their sessions. So for example, one user might want a webapp to stay connected for an hour rather than the webapp's default of fifteen minutes; another user might want to stay connected for a whole day.
Furthermore, you have a special login servlet that performs user authentication and retrieves the object from the database. You want to augment this code to set up the user's specified session duration.
Which code snippet in the login servlet will accomplish this goal?
Furthermore, you have a special login servlet that performs user authentication and retrieves the object from the database. You want to augment this code to set up the user's specified session duration.
Which code snippet in the login servlet will accomplish this goal?
Correct Answer: D
Question 8
In your web application, you need to execute a block of code whenever the session object is first created.
Which design will accomplish this goal?
Which design will accomplish this goal?
Correct Answer: B
Question 9
An appropriate jsp:useBean tag has been placed into a JSP, and identified the bean using the name "theBean".
The bean class includes a method with the following signature:
public boolean isOurCustomer ()
You wish to insert the test true or false into the output HTML based on the return value of this method. Which is true?
The bean class includes a method with the following signature:
public boolean isOurCustomer ()
You wish to insert the test true or false into the output HTML based on the return value of this method. Which is true?
Correct Answer: D
Question 10
You are building a dating service web site. Part of the form to submit a client's profile is a group of radio buttons for the person's hobbies:
20. <input type = 'radio' name = 'hobbyEnum' value = 'HIKING'> Hiking <br>
21. <input type = 'radio' name = 'hobbyEnum' value = 'SKING'> Sking <br>
22. <input type = 'radio' name = 'hobbyEnum' value = 'SCUBA'> SCUBA <br>
23. <! - - and more options - - >>
After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume that an application-scoped hobbies, holds a map between the hobby enumerated type and the display name.
Which EL code snippet will display Nth element of the user's selected hobbles?
20. <input type = 'radio' name = 'hobbyEnum' value = 'HIKING'> Hiking <br>
21. <input type = 'radio' name = 'hobbyEnum' value = 'SKING'> Sking <br>
22. <input type = 'radio' name = 'hobbyEnum' value = 'SCUBA'> SCUBA <br>
23. <! - - and more options - - >>
After the user submits this form, a confirmation screen is displayed with these hobbies listed. Assume that an application-scoped hobbies, holds a map between the hobby enumerated type and the display name.
Which EL code snippet will display Nth element of the user's selected hobbles?
Correct Answer: C