1. 程式人生 > >Java+Tomcat+MySQL實現簡單的網頁註冊和登入

Java+Tomcat+MySQL實現簡單的網頁註冊和登入

<% // HTTP頭資訊Expires告訴代理伺服器它的快取頁面何時將過期 // no-cache:強制快取從伺服器上獲取新的頁面 // no-store: 在任何環境下快取不儲存任何頁面 response.setHeader("Cache-Control","no-store"); response.setHeader("Pragma","no-cache"); response.setDateHeader("Expires",0); %>
<%--we use a form to submit the data inputted by users--%> <%--action=The address to which submitted form data should be sent to--%> <%--method=The HTTP method by which submitted form data should be sent--%> <%--name=The name of the form--%>

使用者登入

使用者名稱: <%--here this data cell will take up two columns--%> <%--here we name the inputted data as username and send it to LoginTestServlet--%> <%--the onfocus attribute is used to clear the default values when the data cell is focused on--%>
密 碼
<%--submit the form--%> <%--reset the inputted data--%> <%--call the goRegister() function on click--%>