JSP first three Chapters quiz: Wrong question

Source: Internet
Author: User
Tags session id

/bin: Storage of script files for starting and stopping Tomcat under various platforms

/logs: Log file that holds Tomcat

Publish directory for/webapps:web apps

/work:tomcat the servlet generated by the JSP is stored in this directory

Cookies: Keep track of user sessions and retain user's last cookie information

Web servers typically receive requests for access from multiple client browsers over a period of time, and access requests to identify the same browser require identification of the requests that are made by the browse, and the same identity ID is attached to the request messages that belong to the same session, and the request messages for different sessions always come with different identity IDs. This identity ID is commonly known as the session ID (SessionID)


GetAttribute (String key): Gets the object saved in session by key
Invalidate (): Set Session object to expire
Therefore, the first output should be null, the third sentence is incorrect after the setting fails


Tomcat as a Web server, you can deploy a Web site to provide support for browser access, and you cannot deploy the C/s program


Out.println will not wrap, because this is in the JSP page, to wrap the line should be entered <br/>

First, the JSP is essentially a servlet, in the background after the dynamic compilation of the final output to the client normal HTML code, so it needs to run in the Servlet container, and Tomcat is the server-side servlet container, so need to run under the server container such as Tomcat, and can output dynamic pages, resulting in a option is correct, the B option is wrong. On the other hand, JSP is all called JavaServer pages, which literally means that a Java-language server-side page technology requires JDK support, so C and D are not.

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.



Cannot define duplicate variable names after using include to introduce index.jsp pages


Take out the attribute value in the Request object, the syntax is: Request.getattribute ("Myatr"), can be coerced type conversion, so AB answer is correct

Response.sendredirect ("index2.jsp"); Redirect, redirect does not carry a value, so the output is null. Answer a is correct

JSP first three Chapters quiz: Wrong question

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.