There are two ways to submit your form: Get and post
<form name= "RegForm" action= "action" method= "Submission method" ></form>
1. Get
Data is submitted in clear text through a URL, and the data is visible in the URL. Submit data can not exceed 2kb, security is lower, but the efficiency is higher than post. It is suitable to submit data with less security, such as search, query and other functions.
2. Post
The information submitted by users is encapsulated in the HTML header, which is suitable for user information with high data volume and security. such as registration, modification, upload and other functions.
Example: login.jsp
<%@ Page Language="Java"Import="java.util.*"ContentType="text/html; Charset=utf-8" %><%StringPath=Request.getcontextpath ();StringBasePath=Request.getscheme ()+"://"+Request.getservername ()+":"+Request.getserverport ()+Path+"/";%><!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"><HTML> <Head> <Basehref= "<%=basePath%>"> <title>My JSP ' login.jsp ' starting page</title> <Metahttp-equiv= "Pragma"content= "No-cache"> <Metahttp-equiv= "Cache-control"content= "No-cache"> <Metahttp-equiv= "Expires"content= "0"> <Metahttp-equiv= "keywords"content= "Keyword1,keyword2,keyword3"> <Metahttp-equiv= "description"content= "This is my page"> <!--<link rel= "stylesheet" type= "Text/css " href= "Styles.css" > - </Head> <Body> <H1>User Login</H1> <HR> <formAction= "dologin.jsp"name= "LoginForm"Method= "POST"> <Table> <TR> <TD>User name:</TD> <TD><inputtype= "text"name= "username"/></TD> </TR> <TR> <TD>Password:</TD> <TD><inputtype= "Password"name= "Password"/></TD> </TR> <TR> <TDcolspan= "2"><inputtype= "Submit"value= "Login"></TD> </TR> </Table> </form> </Body></HTML>
Form form Forms common submission method-get and Post differences