為什么姓名輸?shù)臐h字地址欄卻是這樣
<%@ page language="java" contentType="text/html; charset=UTF-8"
? ? pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";?
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
? ?<h1>用戶登錄</h1>
? ?<hr>
? ?<form action="dologin.jsp" name="loginForm" method="get">
? ? <table>
? ? ? <tr>
? ? ? ? <td>用戶名:</td>
? ? ? ? <td><input type="text" name="username"/></td>
? ? ? </tr>
? ? ? <tr>
? ? ? ? <td>密碼:</td>
? ? ? ? <td><input type="password" name="password"/></td>
? ? ? <tr>
? ? ? <td><input type="submit" value="登錄"/></td>? ? ?
? ? </table>
? ?</form>
</body>
</html>
2019-03-29
url中自動(dòng)轉(zhuǎn)碼,可以使用相關(guān)的函數(shù)獲取到值。
2019-03-29
在tomcat的conf文件夾中server.xml文件,將<Connector >標(biāo)簽中添加URIEncoding="UTF-8"