LOT-959 Free Dumps Study Materials
Question 15: The JSPPortlet is defined as shown in the listing public class JSPPortlet extends GenericPortlet
{ public void doView(RenderRequest request, RenderResponse response) throws PortletException,
IOException { // Set the MIME type for the render response
response.setContentType(request.getResponseContentType());
getPortletContext().getRequestDispatcher("/_JSPPortlet/jsp/html/head.jsp").include(request, response);
getPortletContext().getRequestDispatcher("/_JSPPortlet/jsp/html/body.jsp").include(request, response);
getPortletContext().getRequestDispatcher("/_JSPPortlet/jsp/html/footer.jsp").include(request,
response); } } What output will be displayed to user when he tries to access JSPPortlet in VIEW mode ?
A.User will see markup generated by head.jsp followed by body.jsp followed by footer.jsp
B.The portlet will throw "java.lang.IllegalStateException: The response has already been committed"
exception
C.The JSPPortlet will not compile because PortletRequestDispatcher does not have include() method
D.User will see markup generated by footer.jsp since it is the last call
Correct Answer:A