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

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

我用的eclipse,建立的項(xiàng)目運(yùn)行,照著視頻抄的,出問題了,急求幫助

web.xml

<?xml?version="1.0"?encoding="UTF-8"?>
<web-app?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee?http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID"?version="3.1">
<display-name>MicroMessage</display-name>
<welcome-file-list>
<!--?<welcome-file>index.html</welcome-file>?<welcome-file>index.htm</welcome-file>?-->
<welcome-file>index.jsp</welcome-file>
<!--?<welcome-file>default.html</welcome-file>?<welcome-file>default.htm</welcome-file>?
<welcome-file>default.jsp</welcome-file>?-->
</welcome-file-list>

<servlet>
<!--?接下來(lái)要跳轉(zhuǎn)到一個(gè)列表頁(yè)面?-->
<servlet-name>ListServlet</servlet-name>
<!--?servlet類?-->
<servlet-class>com.imooc.servlet.ListServlet</servlet-class>

</servlet>
<!--?添加映射?-->
<servlet-mapping>
<servlet-name>ListServlet</servlet-name>
<url-pattern>/List.action</url-pattern>
</servlet-mapping>

</web-app>

ListServlet.java

package?com.imooc.servlet;

import?java.io.IOException;

import?javax.servlet.ServletException;
import?javax.servlet.http.HttpServlet;
import?javax.servlet.http.HttpServletRequest;
import?javax.servlet.http.HttpServletResponse;

/**
?*?列表頁(yè)面初始化控制
?*?
?*
?*?@SuppressWarnings("serial")?類可序列化的原因
?*/
@SuppressWarnings("serial")
public?class?ListServlet?extends?HttpServlet?{
	//?實(shí)現(xiàn)doGet方法
	@Override
	protected?void?doGet(HttpServletRequest?req,?HttpServletResponse?resp)
			throws?ServletException,?IOException?{
		req.getRequestDispatcher("/WEB-INF/jsp/back/list.jsp").forward(req,?resp);
	}

	@Override
	protected?void?doPost(HttpServletRequest?req,?HttpServletResponse?resp)
			throws?ServletException,?IOException?{
		//?TODO?Auto-generated?method?stub
		this.doGet(req,?resp);
	}
}

index.jsp

<%@?page?language="java"?contentType="text/html;?charset=UTF-8"
	pageEncoding="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"?"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base?href="<%=basePath%>">
<meta?http-equiv="Content-Type"?content="text/html;?charset=UTF-8">
<title>Insert?title?here</title>
</head>
<body>

</body>
</html>

list.jsp

<%@?page?language="java"?contentType="text/html;?charset=UTF-8"
	pageEncoding="UTF-8"%>
<%?String?path=request.getContextPath();
???String?basePath?=?request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
???<base?href="<%=basePath%>">?%>
<!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html?xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=UTF-8"?/>
<meta?http-equiv="X-UA-Compatible"?content="IE=9;?IE=8;?IE=7;?IE=EDGE"?/>
<title>內(nèi)容列表頁(yè)面</title>
<link?href="<%=basePath?%>resources/css/all.css"?rel="stylesheet"?type="text/css"?/>
</head>
<body?style="background:?#e1e9eb;">
	<form?action=""?id="mainForm"?method="post">
		<div?class="right">
			<div?class="current">
				當(dāng)前位置:<a?href="javascript:void(0)"?style="color:?#6E6E6E;">內(nèi)容管理</a>
				&gt;?內(nèi)容列表
			</div>
			<div?class="rightCont">
				<p?class="g_title?fix">
					內(nèi)容列表?<a?class="btn03"?href="#">新?增</a>&nbsp;&nbsp;&nbsp;&nbsp;<a
						class="btn03"?href="#">刪?除</a>
				</p>
				<table?class="tab1">
					<tbody>
						<tr>
							<td?width="90"?align="right">演示字段1:</td>
							<td><input?type="text"?class="allInput"?value=""?/></td>
							<td?width="90"?align="right">演示字段2:</td>
							<td><input?type="text"?class="allInput"?value=""?/></td>
							<td?width="85"?align="right"><input?type="submit"
								class="tabSub"?value="查?詢"?/></td>
						</tr>
					</tbody>
				</table>
				<div?class="zixun?fix">
					<table?class="tab2"?width="100%">
						<tbody>
							<tr>
								<th><input?type="checkbox"?id="all"?onclick="#"?/></th>
								<th>序號(hào)</th>
								<th>演示字段1</th>
								<th>演示字段2</th>
								<th>操作</th>
							</tr>
							<tr>
								<td><input?type="checkbox"?/></td>
								<td>1</td>
								<td>演示值1</td>
								<td>演示值2</td>
								<td><a?href="#">修改</a>&nbsp;&nbsp;&nbsp;?<a?href="#">刪除</a>
								</td>
							</tr>
							<tr?style="background-color:?#ECF6EE;">
								<td><input?type="checkbox"?/></td>
								<td>2</td>
								<td>演示值1</td>
								<td>演示值2</td>
								<td><a?href="#">修改</a>&nbsp;&nbsp;&nbsp;?<a?href="#">刪除</a>
								</td>
							</tr>
							<tr>
								<td><input?type="checkbox"?/></td>
								<td>3</td>
								<td>演示值1</td>
								<td>演示值2</td>
								<td><a?href="#">修改</a>&nbsp;&nbsp;&nbsp;?<a?href="#">刪除</a>
								</td>
							</tr>
							<tr?style="background-color:?#ECF6EE;">
								<td><input?type="checkbox"?/></td>
								<td>4</td>
								<td>演示值1</td>
								<td>演示值2</td>
								<td><a?href="#">修改</a>&nbsp;&nbsp;&nbsp;?<a?href="#">刪除</a>
								</td>
							</tr>
						</tbody>
					</table>
					<div?class='page?fix'>
						共?<b>4</b>?條?<a?href='###'?class='first'>首頁(yè)</a>?<a?href='###'
							class='pre'>上一頁(yè)</a>?當(dāng)前第<span>1/1</span>頁(yè)?<a?href='###'
							class='next'>下一頁(yè)</a>?<a?href='###'?class='last'>末頁(yè)</a>?跳至&nbsp;<input
							type='text'?value='1'?class='allInput?w28'?/>&nbsp;頁(yè)&nbsp;?<a
							href='###'?class='go'>GO</a>
					</div>
				</div>
			</div>
		</div>
	</form>
</body>
</html>

http://img1.sycdn.imooc.com//59ba9afc0001cd3805440708.jpg

http://img1.sycdn.imooc.com//59ba9b380001dae415800742.jpg

正在回答

6 回答

我很好奇, 放在WEB-INF下的jsp網(wǎng)頁(yè)不是不能直接訪問嗎, 我試了好久, 最后把jsp文件夾放在Webroot下, 再修改servlet的forward路徑, 才可以在瀏覽器里面直接輸入url訪問jsp

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

tinysnail

刪除不了,我寫錯(cuò)了. 實(shí)際上是因?yàn)槲覜]將.html改成jsp
2018-06-02 回復(fù) 有任何疑惑可以回復(fù)我~

代碼沒毛病,我用eclipse跑的,能走通. 檢查你的tomcat配置

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

eclipse上我試了下清緩存,打斷點(diǎn)之類的操作,根本http://localhost:8080/MicroMessage/List.action請(qǐng)求就沒進(jìn)入到ListServlet類,看了幾篇博客又試了下,用IntelliJ IDEA重新構(gòu)建的項(xiàng)目,發(fā)現(xiàn)按照視頻套路出牌確實(shí)還是報(bào)錯(cuò),然后我就試了下http://localhost:8090/List.action? (我將發(fā)布的請(qǐng)求端口號(hào)改掉了8090,因?yàn)楸緳C(jī)HTTP??port 8080和JMX port 1099都被占用)。這樣確實(shí)是請(qǐng)求到頁(yè)面了。理解:從web.xml配置文件出發(fā),也能理解成/List.action映射到ListServlet類,執(zhí)行類的方法,跳轉(zhuǎn)到了list.jsp,不知道我這樣理解對(duì)還是錯(cuò)?

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

qq_木頭人春天_0 提問者

補(bǔ)充 我早上在家用的是自己的電腦,上班用公司的 所以這是不會(huì)有交叉的問題,比如早上端口沖突啥的,不會(huì)發(fā)生
2017-09-15 回復(fù) 有任何疑惑可以回復(fù)我~

早上我試了下清緩存,打斷點(diǎn)之類的操作,根本http://localhost:8090/List.action請(qǐng)求就沒進(jìn)入到ListServlet類,看了幾篇博客又試了下,用IntelliJ IDEA重新構(gòu)建的項(xiàng)目,發(fā)現(xiàn)按照視頻套路出牌確實(shí)還是報(bào)錯(cuò),然后我就試了下http://localhost:8090/List.action,這樣確實(shí)是請(qǐng)求到頁(yè)面了。理解:從web.xml配置文件出發(fā),也能理解成/List.action映射到ListServlet類,執(zhí)行類的方法,跳轉(zhuǎn)到了list.jsp,不知道我這樣理解對(duì)還是錯(cuò)?

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

應(yīng)該是web.xml映射到listSerlet.class由類內(nèi)部doGet方法跳轉(zhuǎn)到list.jsp才對(duì)啊。和表單沒啥關(guān)系。訪問是通過瀏覽器URL訪問的/List.Action。求解

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

404錯(cuò)誤一般是找不到servlet對(duì)應(yīng)的url? 你的jsp頁(yè)面中的form的action沒填

建議你跟著老師一步一步敲代碼吧 老師講得很好

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

舉報(bào)

0/150
提交
取消

我用的eclipse,建立的項(xiàng)目運(yùn)行,照著視頻抄的,出問題了,急求幫助

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

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

幫助反饋 APP下載

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

公眾號(hào)

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