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>