JSP the first three chapters test to correct the wrong problem

Source: Internet
Author: User

(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is that b/s architecture is not a substitute for C/s architecture, some programs such as large-scale network games generally use the C/S architecture.
(select multiple items)
    • A:
    • B:
    • C:
    • D:
The correct answer is A,C,D,The place where the configuration file is stored is conf, so this topic chooses ACD
(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is D,D The answer is wrong, because when the import guide package, different class files are separated by commas, should be: <% @page import= "java.util.*,java.text.*"%>
(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is B,This topic examines the JSP is the page forwarding. Because it is forwarding, you can get the value in the Request object on the a.jsp page. So the correct answer is B.
(select two items)
    • A:
    • B:
    • C:
    • D:
The correct answer is a, B,Set the character encoding of the response: response.setcharacterencoding () or Response.setcontenttype ()
(select two items)
    • A:
    • B:
    • C:
    • D:
The correct answer is that B,c,request.getparameter ("userid") gets the value of the first FORM element named "UserID", and to get the values of multiple form elements with the same name, You need to get through Request.getparametervalues ("UserId") to return an array of strings.
(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is B,Index.jsp in the form in the name of the LoginName final value is bdqn to reach logindo.jsp and then use forwarding to jump to loginsuccess.jsp, so request information is not lost use can get the parameter named LoginName value is BDQN
(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is a, using the page directive's property contenttype: To tell the client browser to display the JSP file in text/html format, and charset encode utf-8 a answer correctly

(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is C, redirect, or jump to another page. You can redirect with the response object. The method is: Response.sendredirect (target page path);

(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is B,Session is mainly access to the state, option A is correct, the session is stored on the server side, option B error, the Session object provides the GetID () method to get the SessionID value, option C is correct, SessionID is saved in the browser's cookie, tracking user status, option D is correct

(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is a, first of all, the session is really to solve the problem of HTTP can not maintain the characteristics of customer status, so a option is correct, the user information is also part of the customer status, so a can see that B is wrong; The security of the session is not dependent on where it resides, but depends on the session implementation mechanism and access mechanism, and the session does not explicitly specify the size limit of its storage space, so C, D is not correct;

(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is a,This topic examines the level of awareness of the built-in object Config in JSP. The Config object is an object that is created automatically when the server starts, and when the servlet is created, it is usually the information required to get initialized. Answer Select a
(Select an item)

A:
    • B:
    • C:
    • D:
The correct answer is a, when forwarding, first obtains the RequestDispatcher object through the Request object, then through the RequestDispatcher object calls the forward method implements the forwarding, the answer is a
(Select an item)
37
    • A:
    • B:
    • C:
    • D:
The correct answer is D, which contains the pages that are included in the page and then executed together. At this time the variable i duplicate
(Select an item)

A:
    • B:
    • C:
    • D:
the correct answer is that c,session is maintained by the server side, but SessionID can also be saved in the client browser. So the C answer is wrong

(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is a,Response.sendredirect ("index2.jsp"); redirect, the value in the request object cannot be reached, so the output is null. Answer a is correct
(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is C,Redirection (Sendredirect) is initiated by the client browser, and the parameter in the request is lost. Note the difference between summary redirection (SENDREDIRECT) and forwarding (forward).
(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is C, and all JSPs are translated into the servlet's source code (Java) by the container after the client makes the request, and then the source (Java) is compiled into the servlet class, which is put into memory.  Among them, <%! int a=0;%> defines a member variable of a class, <% int b=0; %> is defined as a local variable in the service method. In addition to the first request, only the service method is called for the other two requests. The answer is C.
(Select an item)
    • A:
    • B:
    • C:
    • D:
The correct answer is C,

1 syntax for writing cookies:

Response.addcookie (Cookname);

Response.sendredirect ("Address");

2 Read cookie information:

Request.getcookies ();

JSP the first three chapters test to correct the wrong problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.