First knowledge:
<% @ Page language = "java" import = "java. util. * "pageEncoding =" UTF-8 "%> <% String path = request. getContextPath (); String basePath = request. getScheme () + ": //" + request. getServerName () + ":" + request. getServerPort () + path + "/"; %>My JSP 'index. jsp 'starting page
User Name
Password:
Set the attribute value of JavaBean through parameters in the HTTP Form
<% @ Page language = "java" import = "java. util. * "pageEncoding =" UTF-8 "%> <% String path = request. getContextPath (); String basePath = request. getScheme () + ": //" + request. getServerName () + ":" + request. getServerPort () + path + "/"; %>My JSP 'index. jsp 'starting page
User Name
Password:
The output may contain garbled characters when entering Chinese characters.
You can write code in the. java file.
public String getPassword() {try {byte b[] = password.getBytes("ISO-8859-1");password = new String(b, "UTF-8");return password;} catch (Exception e) {// TODO: handle exceptionreturn password;}}