Developing Applications with Java EE 6 on WebLogic Server 12c Ed 3 Quiz Questions and Answers

Given: 10. public void service(ServletRequest request, 11. ServletResponse response) { 12. ServletInputStream sis = 13. // insert code here 14. } Which retrieves the binary input stream on line 13?

Answer :
  • request.getInputStream();

Which method is required for using the URL rewriting mechanism of implementing session support?

Answer :
  • HttpServletResponse.encodeURL()

Which of the following action variable is used to include a file in JSP?

Answer :
  • jsp:include

Which object stores references to the request and response objects?

Answer :
  • pageContext

What temporarily redirects response to the browser?

Answer :
  • response.sendRedirect(URL)

In a servlet, how can you retrieve the existing session if it exists?

Answer :
  • request.getSession(false);

Which of the following code retrieves the body of the request as binary data?

Answer :
  • DataInputStream data = request.getInputStream()

How are java web applications packaged?

Answer :
  • war

Which page directive should be used in JSP to generate a PDF page?

Answer :
  • contentType

Which restriction is true about the ejbCreate method of an Entity Bean?

Answer :
  • The method must not be declared as final or static.