javaBean實(shí)例賦值 中文有亂碼 請(qǐng)大神看一眼
login文件 <%@?page?language="java"?import="java.util.*?"?????? contentType="text/html;?charset=utf-8"%> ?<% String?path?=?request.getContextPath(); String?basePath?=?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"> <html> <head> ? <title>My?JSP?'index.jsp'?starting?page</title> <meta?http-equiv="pragma"?content="no-cache"> <meta?http-equiv="cache-control"?content="no-cache"> <meta?http-equiv="expires"?content="0"> <meta?http-equiv="keywords"?content="keyword1,keyword2,keyword3"> <meta?http-equiv="description"?content="This?is?my?page"> <!-- <link?rel="stylesheet"?type="text/css"?href="styles.css"> --> <style> ? </style> </head> <body> ? <fieldset> <legend>login</legend> <h1>提交</h1> 密碼 <form?action="dologin.jsp"?name="loginform"?method="post"> <br>?用戶(hù)名<input?type="text"?name="username">?<br>?密碼<input type="password"?name="password">?<br>?愛(ài)好<input type="checkbox"?name="favorite"?value="ww">?看歷史<br>?<input type="checkbox"?name="favorite"?value="music">欣賞音樂(lè)?<br> <input?type="checkbox"?name="favorite"?value="欣賞電影">欣賞電影?<br> <input?type="checkbox"?name="favorite"?value="運(yùn)動(dòng)">運(yùn)動(dòng)?<br> <input?type="submit"?value="登錄"> </form> </fieldset> ? ? ???????? </body> </html>
dologin文件
<%@?page?language="java"?import="java.util.*?" contentType="text/html;?charset=utf-8"%> <% String?path?=?request.getContextPath(); String?basePath?=?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; %> <!DOCTYPE?HTML?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"> <html> <head> <base?href="<%=basePath%>"> <title>My?JSP?'index.jsp'?starting?page</title> <meta?http-equiv="pragma"?content="no-cache"> <meta?http-equiv="cache-control"?content="no-cache"> <meta?http-equiv="expires"?content="0"> <meta?http-equiv="keywords"?content="keyword1,keyword2,keyword3"> <meta?http-equiv="description"?content="This?is?my?page"> <!-- <link?rel="stylesheet"?type="text/css"?href="styles.css"> --> <style> </style> </head> <body> <jsp:useBean?id="user"?class="po.Users"?scope="page"></jsp:useBean> <jsp:setProperty?property="*"?name="user"?/> 用戶(hù)名:<%=user.getUsername()?%> <br>?密碼:<%=user.getPassword()?%><br> </body> </html>
2017-03-02
request.setCharacterEncoding("utf-8");
2022-03-24
沒(méi)有啊,我的很正常你需要下載完整的bootstrap.css文件,然后引入到你的index.html文件中來(lái),比如我們的小節(jié)中引入的是網(wǎng)上公開(kāi)的bootstrap.css文件地址。