赞
踩
httpRequest.getRequestDispatcher("/helloWorld").forward(httpRequest, response);
服务器端转发,不改变浏览器端URL地址,常用
httpResponse.sendRedirect(uri);
浏览器端重定向,改变URL在浏览器地址栏
URLOverWriteFilter.java
- package com.web1.util;
-
- import java.io.IOException;
-
- import javax.print.attribute.standard.ReferenceUriSchemesSupported;
- import javax.servlet.Filter;
- import javax.servlet.FilterChain;
- import javax.servlet.FilterConfig;
- import javax.servlet.ServletException;
- import javax.servlet.ServletRequest;
- import javax.servlet.ServletResponse;
- import javax.servlet.annotation.WebFilter;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
-
- /**
- * Servlet Filter implementation class URLOverWriteFilter
- */
- @WebFilter("/URLOverWriteFi
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。