第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

求問jsp這里的代碼哪里有錯(cuò)

求問jsp這里的代碼哪里有錯(cuò)

漫之旅 2016-11-22 19:33:49
這是第一個(gè)頁面 <%@?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"> --> ??</head> ?? ??<body> <form?name=test?action=admin.jsp?method="post"> <div?id=t> <label>賬號(hào):</label><input?type="text"name=username?value=""> <label>密碼</label><input?type="password"?name="password"?value=""> <input?type="submit"value="登錄"> </div> </form> ??</body> </html>這是提交的頁面<%@ 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+"/";String name=request.getParameter("username");String password=request.getParameter("password");request.setCharacterEncoding("utf-8");if("admin".equals(name)&&"admin".equals(password)){ request.getRequestDispatcher("admin1").forward(request,response);}else{ response.sendRedirect("admin2");}%>admin1和2我都什么都沒寫,但是點(diǎn)了轉(zhuǎn)發(fā)或者重定向都會(huì)出錯(cuò)<%@ 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+"/";%>
查看完整描述

2 回答

已采納
?
qq_連環(huán)_04358155

TA貢獻(xiàn)34條經(jīng)驗(yàn) 獲得超5個(gè)贊

admin1和2是jsp嗎,如果是沒有后綴啊,而且提交的頁面一般都是servlet,這樣才好處理內(nèi)容啊

查看完整回答
反對(duì) 回復(fù) 2016-11-25
?
我的南方

TA貢獻(xiàn)63條經(jīng)驗(yàn) 獲得超27個(gè)贊

“admin.jsp” 雙引號(hào)都沒有。。。。。。

查看完整回答
反對(duì) 回復(fù) 2016-11-28
  • 2 回答
  • 0 關(guān)注
  • 1189 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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