You have built a web application with tight security. Several directories of your webapp are used for internal purposes and you have overridden the default servlet to send an HTTP 403 status code for any request thatmaps to one of these directories. During testing, the Quality Assurance director decided that they did NOTlike seeing the bare response page generated by Firefox and Internet Explorer. The director recommendedthat the webapp should return a more user-friendly web page that has the same look-and-feel as the webapp plus links to the webapp’s search engine. You have created this JSP page in the /WEB-INF/jsps/error403.jsp file. You do NOT want to alter the complex logic of the default servlet.
How can you declarethat the web container must send this JSP page whenever a 403 status is generated?()
A.
B.
C.
D.
您可能感興趣的試卷
你可能感興趣的試題
Click the Exhibit button.
As a maintenance feature, you have created this servlet to allow you to upload and remove files on yourweb server. Unfortunately, while testing this servlet, you try to upload a file using an HTTP request and onthis servlet, the web container returns a 404 status.
What is wrong with this servlet?()
A.HTTP does NOT support file upload operations.
B.The servlet constructor must NOT have any parameters.
C.The servlet needs a service method to dispatch the requests to the helper methods.
D.The doPut and doDelete methods do NOT map to the proper HTTP methods.
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?()
A.request.getWriter();
B.request.getReader();
C.request.getInputStream();
D.request.getResourceAsStream();
You need to retrieve the username cookie from an HTTP request. If this cookie does NOT exist, then the cvariable will be null.
Which code snippet must be used to retrieve this cookie object?()
A.
B.
C.
D.
You are creating a servlet that generates stock market graphs. You want to provide the web browser withprecise information about the amount of data being sent in the response stream.
Which twoHttpServletResponse methods will you use to provide this information?()
A.response.setLength(numberOfBytes);
B.response.setContentLength(numberOfBytes);
C.response.setHeader("Length", numberOfBytes);
D.response.setIntHeader("Length", numberOfBytes);
E.response.setHeader("Content-Length", numberOfBytes);
F.response.setIntHeader("Content-Length", numberOfBytes);
Your web page includes a Java SE v1.5 applet with the following declaration:
11.<object classid=’clsid:CAFEEFAC-0015-0000-0000-ABCDEFFEDCBA’
12.width=’200’ height=’200’>
13.<param name=’code’ value=’Applet.class’ />
14.</object>
Which HTTP method is used to retrieve the applet code?()
A.GET
B.PUT
C.POST
D.RETRIEVE
最新試題
Click the ’Select and Place’ button.Place the events in the order they occur.
Which element of a web application deployment descriptor element is required?()
Click the ’Select and Place’ button.Place the events in the order they occur.
Click the ’Select and Place’ button.Place the events in the order they occur.
The JSP developer wants a comment to be visible in the final output to the browser.Which comment styleneeds to be used in a JSP page?()
Which ensures that a JSP response is of type "text/plain"?()
Given tutorial.jsp:2.EL Tutorial3.Example 14.5.Dear ${my:nickname(user)}6.Which, when added to the web application deployment descriptor,ensures that line 5 is included verbatimin the JSP output?()
You are building your own layout mechanism by including dynamic content for the page’s header and footersections. The footer is always static, but the header generates the <title> tag that requires the page name tobe specified dynamically when the header is imported.Which JSP code snippet performs the import of theheader content?()
Which three are true about servlet filters?()
Click the Exhibit button.The attribute "name" has a value of "Foo,"What is the result if this tag handler’s tag is invoked?()