Struts2拦截器-abstractInterceptor

通过继承AbstractInterceptor类,重写intercept方法,实现拦截器;

需要在Struts2中初始化需要放行的action名称

具体流程:

1.新建Struts2项目(MyEclipse自动配置Struts2环境)

Struts2拦截器-abstractInterceptor

2.新建页面(index.jsp)

Struts2拦截器-abstractInterceptor

3.新建页面(login.jsp)

Struts2拦截器-abstractInterceptor

4.新建实体类(UserInfo)

Struts2拦截器-abstractInterceptor

5.新建action类(BasicAction)

Struts2拦截器-abstractInterceptor

6.配置Struts2.xml

Struts2拦截器-abstractInterceptor

7.新建拦截器(MyAbsInterceptor)

Struts2拦截器-abstractInterceptor

Struts2拦截器-abstractInterceptor

8.配置Struts2.xml

Struts2拦截器-abstractInterceptor