Oracle 1Z0-899 Online Practice
Questions and Exam Preparation
1Z0-899 Exam Details
Exam Code
:1Z0-899
Exam Name
:Java EE 6 Web Component Developer Certified Expert
Certification
:Oracle Certifications
Vendor
:Oracle
Total Questions
:108 Q&As
Last Updated
:Dec 07, 2021
Oracle 1Z0-899 Online Questions &
Answers
Question 11:
Given a web fragment jar file, where should we put the web fragment.xml inside the jar file?
A. WEB-INF B. META-INF C. WEB-INF/lib D. WEB-INF/classes E. META-INF/services
C. WEB-INF/lib
*
If you're dealing with web applications, /WEB-INF/lib is the portable place to put JARs. This is where web servers servlet containers expect to find an application's jar files.
*
The /WEB-INF/classes directory is on the ClassLoader's classpath. This is where .class files are loaded from when the web application is executing. Any JAR files placed in the /WEB- INF/lib directory will also be placed on the ClassLoader's classpath.
Question 12:
You are creating a new ISP page and you need to execute some code that acts when the- page is first executed, but only once. Which three are possible mechanisms for performing this initialization code? (Choose three)
A. In the init method. B. In the jspInit method. C. In the constructor of the JSP's Java code. D. In a JSP declaration, which includes an initializer block. E. In a JSP declaration, which includes a static initializer block.
B. In the jspInit method. D. In a JSP declaration, which includes an initializer block. E. In a JSP declaration, which includes a static initializer block.
Question 13:
Which of the following annotations relate to security in a servlet? (i) @WebSecurity (ii) @RolesAllowed
(iii) @WebConstraint
(iv)
@HttpConstraint
(v)
@Servletsecurity
A. (i) only B. (i) and (iii) C. (iv) and (v) D. (iii) and (v) E. (ii) and (iv)
C. (iv) and (v)
Question 14:
Which defines the welcome files in a web application deployment descriptor?
A. / welcome - jsp /index-html B. welcome .jsp index.html C. welcome.jsp D. welcome .jsp /index.html E. welcome welcome.jsp index index
B. welcome .jsp index.html
Question 15:
Servlet A forwarded a request to servlet B using the forward method of RequestDispatcher. What attribute in B's request object contains the URI of the original request received by servlet A?
A. REQUEST_URI B. javax.servlet.forward.request_uri C. javax.servlet.forward.REQUEST_URI D. javax.servlet.request_dispatcher.request_uri E. javax.servlet.request_dispatcher.REQUEST_URI
B. javax.servlet.forward.request_uri
Question 16:
Which code snippet specifies the metadata for a servlet with:
(i)
url mapping "/mytest"'
(ii)
Initial parameter with name "debug" and value "10"' (iii) Support asynchronous operation?
A. @WebServlet("/mytest") @InitParam(name-"debug" va1ue = "10") @Asynchronous public class TestServlet extends HttpServlet {} B. @WebServlet ("/myset") @WebParam(name = "debug" value = "10") Public class testServlet {} C. @WebServlet (urlPatterns = { / "mytest"}, Initparams = {@InitParam (name = "debug", value = "10") }, supportAsync = true) public class TestServlet extends HttpServlet {} D. @WebServlet (urlPatterns = { / "mytest"}, Initparams = {@InitParam (name = "debug", value = "10") }, asyncSupported = true) public class TestServlet extends HttpServlet {} E. @WebServlet (urlPatterns = { / "mytest"}, Initparam = @WebInitParam (name = "debug", value = "10"), supportAsync = true) public class testServlet {}
D. @WebServlet (urlPatterns = { / "mytest"}, Initparams = {@InitParam (name = "debug", value = "10") }, asyncSupported = true) public class TestServlet extends HttpServlet {}
Question 17:
Which EL expression evaluates to the request URI?
A. ${requestURI} B. ${request.URI} C. ${request.getURI} D. ${request.requestURI} E. ${requestScope.requestURI} F. ${pageContext.request.requestURI} G. ${requestScope.request.requestDRI}
Where wf.jar contains a valid web-fragment.xml and the following two classes: MyFilter1.class and MyFiler2.class.
The web-fragment.xml is as follows:
The following are some code snippets:
When one access "/" of the above web application, which filters will be executed?
A. No filters will be executed. B. MyFilter1 C. MyFilter2 D. MyFilter1 and MyFilter2
C. MyFilter2
Note:
*
This tag specifies a filter name, and either a URL mapping or servlet name, for a filter that has been defined with the tag.
Multiple tags can be specified for a single , providing different URL patterns. See the tag for examples.
The has two required elements:
- the filter name, as specified in the element of the tag Either a or a .
If a servlet name is specified, the filter will be called whenever the specific servlet is called.
Question 19:
Which of the following are attributes of the annotation javax.servlet.annotation.WebFiler?
(i)
Name
(ii)
servletNames
(iii) urlPatterns
(iv)
dispatcherTypes
(v)
supportAsync
A. (iii) only B. (iii) and (iv) C. (ii), (iii) and (iv) D. (iii), (iv) and (v) E. (ii), (iii), (iv) and (v)
B. (iii) and (iv)
*
(iii) urlPatterns
The URL patterns to which the filter applies
*
(iv) dispatcherTypes
The dispatcher types to which the filter applies
*
(not V): asyncSupported
Declares whether the filter supports asynchronous operation mode.
Note:
*
javax.servlet.annotation Annotation Type WebFilter
Annotation used to declare a servlet filter.
This annotation is processed by the container at deployment time, and the corresponding filter applied to the specified URL patterns, servlets, and dispatcher types.
Question 20:
View the Exhibit.
Assume the product attribute does NOT yet exist in any scope. Which two create an instance of com.example.Product and initialize the name and price properties to the name and price request parameters? (Choose two)
Nowadays, the certification exams become more and more important and required by more and more
enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare
for the exam in a short time with less efforts? How to get a ideal result and how to find the
most reliable resources? Here on Vcedump.com, you will find all the answers.
Vcedump.com provide not only Oracle exam questions,
answers and explanations but also complete assistance on your exam preparation and certification
application. If you are confused on your 1Z0-899 exam preparations
and Oracle certification application, do not hesitate to visit our
Vcedump.com to find your solutions here.