Basic syntax of JSP and simple form processing

Source: Internet
Author: User

JSP syntax

JSP directive elements

(1) Include: Import other folders

(2) Page:

Language: In what language, only Java

Contenttype:mime type

Import: Importing Java Packages

(3) Taglib: Custom Tag Library

JSP Common standard elements

(1) Jsp:forward: Jump to other pages

(2) Jsp:include: Insert other documents eg:

(3) Jsp:plugin: Insert Applet Small Program

(4) Jsp:param: Parameter Transfer value

JSP built-in objects

(1) Request: Common methods

GetParameter (): Extracts the value of a FORM element

GETREMOTEADDR (): Getting Client IP values

(2) Response:

Sendredirect (): Redirect to another page

setContentType (); Set MIME value

(3) Out: Output to the Web page

(4) Application

SetAttribute (string,object) holds the value of the variable in application;

GetAttribute (String) to get the value saved in Applicaion

RemoveAttribute (String) to delete values saved in application

(5) session

SetAttribute (String,object) Saves the value of the variable in session;

GetAttribute (String) to get values saved in session

RemoveAttribute (String) deletion is saved in the

JSP syntax

JSP directive elements

(1) Include: Import other folders

(2) Page:

Language: In what language, only Java

Contenttype:mime type

Import: Importing Java Packages

(3) Taglib: Custom Tag Library

JSP Common standard elements

(1) Jsp:forward: Jump to other pages

(2) Jsp:include: Insert other documents eg:

(3) Jsp:plugin: Insert Applet Small Program

(4) Jsp:param: Parameter Transfer value

JSP built-in objects

(1) Request: Common methods

GetParameter (): Extracts the value of a FORM element

GETREMOTEADDR (): Getting Client IP values

(2) Response:

Sendredirect (): Redirect to another page

setContentType (); Set MIME value

(3) Out: Output to the Web page

(4) Application

SetAttribute (string,object) holds the value of the variable in application;

GetAttribute (String) to get the value saved in Applicaion

RemoveAttribute (String) to delete values saved in application

(5) session

SetAttribute (String,object) Saves the value of the variable in session;

GetAttribute (String) to get values saved in session

RemoveAttribute (String) to delete values saved in session

GetID: Get Session number

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.