jsp jsf xhtml faces url-pattern

JSP is an old view technology and widely used in combination with JSF 1.x. Facelets (XHTML) is the successor of JSP and introduced as default view technology of JSF 2.x at end of 2009. When you were seeing JSPs, you were perhaps reading old/outdated books/tutorials/resources targeted on JSF 1.x. You should generally ignore them when…

filter 和 aop

现在AOP的设计开发理念在软件开发中用的越来越广泛,在我们开发的软件中也广泛进行了使用。而最常用的就是filter和interceptor。 Filter 该过滤器的方法是创建一个类XXXFilter实现此接口,并在该类中的doFilter方法中声明过滤规则,然后在配置文件web.xml中声明他所过滤的路径 <filter> <filter-name>XXXFilter</filter-name> <filter-class> com.web.util.XXXFilter </filter-class> </filter> <filter-mapping> <filter-name>XXXFilter</filter-name> <url-pattern>*.action</url-pattern> </filter-mapping> Interceptor 该过滤器的方法也是创建一个类XXXInterceptor实现此接口,在该类中intercept方法写过滤规则,不过它过滤路径的方法和Filter不同,它与strut.xml结合使用(其他开发框架各自有自己的切入点), 创建一个strus.xml的子配置文件struts-l99-default.xml,它继承与struts2的struts-default,此配置文件是其他子配置文件的父类,只要是继承与该文件的配置文件所声明的路径都会被它过滤 如下 <package name=”XXX-default” namespace=”/” extends=”struts-default”> <interceptors> <interceptor name=”authentication” /> <interceptor-stack name=”user”> <interceptor-ref name=”defaultStack” /> <interceptor-ref name=”authentication” /> </interceptor-stack> <interceptor-stack name=”user-submit”> <interceptor-ref name=”user” /> <interceptor-ref name=”token” /> </interceptor-stack>   <interceptor-stack name=”guest”> <interceptor-ref name=”defaultStack” /> </interceptor-stack>   <interceptor-stack name=”guest-submit”> <interceptor-ref name=”defaultStack”…

JSP Servlet Filter

Basic Servlet Filters are the latest components that are added in Servlet 2.3 specifications. These filters are used basically for intercepting and modifying requests and response from server.  Consider a scenario where you want to check session from the every users request and if it is valid then only you want to let the user…