[JSP] Form submission and Form Verification

Source: Internet
Author: User

Summary:

(1) If you use form to submit data, the submitted data will be processed on another JSP page. You can also use Ajax for partial updates without redirecting.

(2) When data verification is required before a form is submitted, the onsubmit event in the form is returned. If the data is valid, true is returned, and page Jump is implemented. If the data is not required, false is returned, the page will not jump.

(3) the transmission of Chinese parameters should be considered. Because the default encoding of browsers, Web servers, databases, and so on is inconsistent, Chinese garbled characters may easily occur (refer to: Solve JSP Chinese garbled characters and modify MySQL encoding ).

The following is a simple example of Form submission and form verification.

<% @ Page Language = "Java" contenttype = "text/html; charset = UTF-8" pageencoding = "UTF-8" %> <% @ page import = "Java. util. * "%> <% @ page import =" Java. SQL. * "%> <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en" "http://www.w3.org/TR/html4/loose.dtd"> <HTML> 

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.