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

為了賬號安全,請及時綁定郵箱和手機立即綁定

eclipse jee+tomcat8.0.x+servlet3.1 采用注釋的方法,在jsp調(diào)用報錯找不到

<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8"%>



<!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">

-->

? </head>

??

? <body>

? ? ?<h1>使用Eclipse創(chuàng)建Servlet小例子</h1>

? ? <hr>

? ? <a href="/HelloServlet">Get方式請求HelloServlet</a><br>

? </body>

</html>

//

//

package servlet;


import java.io.IOException;

import javax.servlet.Servlet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;


/**

?* Servlet implementation class HelloServlet

?*/

@WebServlet(asyncSupported = true, urlPatterns = { "/HelloServlet" })

public class HelloServlet extends HttpServlet implements Servlet {

private static final long serialVersionUID = 1L;

? ? ? ?

? ? /**

? ? ?* @see HttpServlet#HttpServlet()

? ? ?*/

? ? public HelloServlet() {

? ? ? ? super();

? ? ? ? // TODO Auto-generated constructor stub

? ? }


/**

* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)

*/

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

// TODO Auto-generated method stub

response.getWriter().append("Served at: ").append(request.getContextPath());

}


/**

* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)

*/

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

// TODO Auto-generated method stub

doGet(request, response);

}


}


正在回答

4 回答

為什么這樣還是訪問不到地址

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

相比配置 web.xml ,我還是喜歡用注解。

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

= =解決了 用了我一天

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

盯叮町玎仃

你好,請問是怎么解決的?
2017-06-13 回復(fù) 有任何疑惑可以回復(fù)我~

<!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">

-->

? </head>

??

? <body>

? ? ?<h1>使用Eclipse創(chuàng)建Servlet小例子</h1>

? ? <hr>

? ? <a href="/HelloServlet">Get方式請求HelloServlet</a><br>

? </body>

</html>

//

//

package servlet;


import java.io.IOException;

import javax.servlet.Servlet;

import javax.servlet.ServletException;

import javax.servlet.annotation.WebServlet;

import javax.servlet.http.HttpServlet;

import javax.servlet.http.HttpServletRequest;

import javax.servlet.http.HttpServletResponse;


/**

?* Servlet implementation class HelloServlet

?*/

@WebServlet(asyncSupported = true, urlPatterns = { "/HelloServlet" })

public class HelloServlet extends HttpServlet implements Servlet {

private static final long serialVersionUID = 1L;

? ? ? ?

? ? /**

? ? ?* @see HttpServlet#HttpServlet()

? ? ?*/

? ? public HelloServlet() {

? ? ? ? super();

? ? ? ? // TODO Auto-generated constructor stub

? ? }


/**

* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)

*/

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

// TODO Auto-generated method stub

response.getWriter().append("Served at: ").append(request.getContextPath());

}


/**

* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)

*/

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

// TODO Auto-generated method stub

doGet(request, response);

}


}



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

舉報

0/150
提交
取消

eclipse jee+tomcat8.0.x+servlet3.1 采用注釋的方法,在jsp調(diào)用報錯找不到

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

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

幫助反饋 APP下載

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

公眾號

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