beforeresultinterceptor.java

来自「工厂版本管理系统,STRUTS2框架,用于管理商品的版本,便于有效的控制版本」· Java 代码 · 共 32 行

JAVA
32
字号
package com.bluesky.web.struts2.interceptor;import com.opensymphony.xwork2.Action;import com.opensymphony.xwork2.ActionInvocation;import com.opensymphony.xwork2.interceptor.AbstractInterceptor;import com.opensymphony.xwork2.interceptor.PreResultListener;/* * this is a AFTER intercepter, just like the Preparable interceptor. */public class BeforeResultInterceptor extends AbstractInterceptor {    /**	 * 	 */	private static final long serialVersionUID = 1L;	public String intercept(ActionInvocation invocation) throws Exception {       Action action = (Action)invocation.getAction();              if (action instanceof PreResultListener) {    	       	   PreResultListener listener = (PreResultListener) action;    	       	   invocation.addPreResultListener(listener);    	          }              String resultCode = invocation.invoke();       return resultCode;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?