最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

為什么我用提交按鈕提交會(huì)是這樣,名字輸入的中文,下面的愛(ài)好后面是啥?


User: ??
frivious:[Ljava.lang.String;@24ca1465
read
swam
password:123?

我的代碼

request.jsp:

<%@ 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 'request.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">

-->

? </head>

? <body>

??

? <h1>inner request</h1>

? <%

??

? String expr = new String(request.getParameter("Username").getBytes("ISO-8859-1"),"UTF-8");?

? request.setCharacterEncoding("utf-8");

? request.setAttribute("password", "123");


? %>

? User: <%=expr %><br>

? frivious:<%=request.getParameterValues("frivious") %><br>

? <%

? if(request.getParameterValues("frivious")!=null){

? String[] frivious=request.getParameterValues("frivious");

? for(int i=0;i<frivious.length;i++){

? out.print(frivious[i]+"<br>");

? }

? }

? ?%>

? ?password:<%=request.getAttribute("password")%>

? </body>

</html>

=====================================

=============req.jsp:========================

<%@ 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 'req.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">

-->


? </head>

??

? <body>

? ?<form name="req" action="request.jsp" method="get">

? ?<table>

? ?<tr>

? ?<td>Username</td>

? ?<td><input type="text" name="Username"></td>

? ?</tr>

? ?<tr>

? ?<td>fravious</td>

? ?<td><input type="checkbox" name="frivious" value="read">read

? ?<input type="checkbox" name="frivious" value="music">music

? ?<input type="checkbox" name="frivious" value="swam">swam

? ?<input type="checkbox" name="frivious" value="foot">foot

? ??

? ?</td>

? ?</tr>

? ?<tr>

? ?<td colspan="2"><input type="submit" value="value"></td>

? ?</table>

??

? ?</form>

? ?<br>

? ?<br>

? ? <a href="request.jsp?Username=王五">test of the URl</a>

? </body>

</html>


正在回答

1 回答

親,我覺(jué)得你的favorites(frivious)輸出的結(jié)果是“[Ljava.lang.String;@24ca1465”的原因是因?yàn)槟阒苯虞敵隽艘粋€(gè)數(shù)組,這樣是不正確的,你的這種行為類(lèi)似于out.print(s),其中s是數(shù)組,二對(duì)于s你不應(yīng)該直接輸出它,而是應(yīng)該依次輸出其中的元素。

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

黑豆0 提問(wèn)者

非常感謝!
2016-02-28 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

為什么我用提交按鈕提交會(huì)是這樣,名字輸入的中文,下面的愛(ài)好后面是啥?

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)