urlrewrite -- url重写

urlrewrite:地址重写,将请求url进行处理

1.pom.xml添加依赖

       
       
            org.tuckey
            urlrewritefilter
            3.0.4
            
                
                    log4j
                    log4j
                
            
        

2.web.xml添加url拦截


	
		UrlRewriteFilter
		org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
	
	
		UrlRewriteFilter
		/*
		REQUEST
		FORWARD
	
	

3.WEB-INF下添加urlrewrite.xml



	
		^/blackBox$
		/blackBox/index
	

测试:访问"localhost:8080/blackBox"将被重写成"localhost:8080/blackBox/index"

你可能感兴趣的:(架构设计)