亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

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

幫忙看看為什么沒有輸出

//Filter類

package com.Filter;


import java.io.IOException;


import javax.servlet.FilterChain;

import javax.servlet.FilterConfig;

import javax.servlet.ServletException;

import javax.servlet.ServletRequest;

import javax.servlet.ServletResponse;


public class MyfirstFilter implements javax.servlet.Filter {


@Override

public void destroy() {

System.out.println("銷毀過濾器");

}


@Override

public void doFilter(ServletRequest arg0, ServletResponse arg1, FilterChain arg2)

throws IOException, ServletException {

System.out.println("開始調用doFilter方法");

arg2.doFilter(arg0, arg1);

System.out.println("結束調用doFilter方法");

}


@Override

public void init(FilterConfig arg0) throws ServletException {

System.out.println("過濾器初始化");

}

}

//web.xml配置

<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5"?

xmlns="http://java.sun.com/xml/ns/javaee"?

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?

xsi:schemaLocation="http://java.sun.com/xml/ns/javaee?

http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

? <display-name></display-name>

? <welcome-file-list>

? ? <welcome-file>index.jsp</welcome-file>

? </welcome-file-list>

? <filter>

? <filter-name>FirstFilter</filter-name>

? <filter-class>com.Filter.MyfirstFilter</filter-class>

? </filter>

? <filter-mapping>

? <filter-name>FirstFilter</filter-name>

? <url-pattern>/index.jsp</url-pattern>

? </filter-mapping>

</web-app>


//index.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Insert title here</title>

</head>

<body>

<h1>過濾器</h1>

<hr>

</body>

</html>


正在回答

2 回答

Web版本用的3.0 ?已解決謝謝

0 回復 有任何疑惑可以回復我~
#1

qq_與贈_03193390

3.0版本就不行嗎?
2017-10-03 回復 有任何疑惑可以回復我~

不清楚,感覺可以的啊

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

幫忙看看為什么沒有輸出

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號