java--jsp

Source: Internet
Author: User

First, the JSP directive:

Page directive

Include directives: include additional files through the include directive. The included file can be a JSP file, an HTML file, or a text file. The contained file is as if it were part of the JSP file and will be compiled at the same time.

<%@ include file="Relative url" %> The file name in the include directive is actually a relative URL. If you do not associate a path to the file, the JSP compiler looks for it by default under the current path.

TAGLIB directive: The taglib directive introduces the definition of a custom label collection, including the library path, the custom label.

<%@ taglib uri="uri" prefix= "prefixoftag" %> URI property determines the location of the tag library, The prefix property specifies the prefix for the tag library.

JSP behavior: JSP behavior tag

JSP action elements: Unlike JSP Directive elements, JSP action elements work in the request processing phase. JSP action elements are written in XML syntax.

JSP actions can be used to dynamically insert files, reuse JavaBean components, redirect users to additional pages, and generate HTML code for Java plugins.

The action element has only one syntax, which conforms to the XML standard:<jsp:action_name attribute="value" />

All action elements have two attributes: The id attribute and the Scope property.

The id attribute is a unique identifier for an action element and can be referenced in a JSP page. The ID value created by the action element can be called through PageContext.

This property is used to identify the life cycle of an action element. The id attribute has a direct relationship to the scope property, and the scope property defines the lifetime of the associated ID object.

The scope attribute has four possible values: (a) page, (b) request, (c) session, and (d) application.

Second, JSP nine large built-in objects (implicit objects, predefined variables):

An instance of the Out object PrintWriter class used to output the result to a Web page

Request Object HttpServletRequest instance of class

An instance of the response object HttpServletResponse class

Instance of the Session object HttpSession class

Application object: an instance of theServletContext class, related to the application context, enables the sharing of data between users, which can hold global variables

An instance of the PageContext object PageContext class that provides access to all objects and namespaces of the JSP page

Config object ServletConfig instance of class

An object of the Exception object Exception class that represents the corresponding exception object in the JSP page where the error occurred

Page object: Similar to the This keyword in a Java class

Third, the JSP program commonly used development mode:

A simple JSP mode

Jsp+javabean small or medium-sized websites are not flexible

Jsp+servlet+javabean

MVC pattern

java--jsp

Related Article

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.