Interceptor.java
package struts2;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Map;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.Interceptor;
public class InterceptorTest implements Interceptor {
private String content="c:/pinbi1.txt";
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
@Override
public void destroy() {
// TODO Auto-generated method stub
System.out.println("cccccccc");
}
@Override
public void init() {
// TODO Auto-generated method stub
System.out.println("wwwwww");
}
@Override
public String intercept(ActionInvocation arg0) throws Exception {
// TODO Auto-generated method stub
System.out.println("interceptor");
FileReader fr = new FileReader(content);
BufferedReader br = new BufferedReader(fr);
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
arg0.invoke();
return "success";
}
}
- 深圳市一键一家网络科技有限公司官方网址:http://www.songhu9.com.cn
- QQ:316675593,电话号码:19807655856
- 业务范围:公司网站建设、管理软件研发、软件网站二次开发、400电话、电商平台研发、公众号研发!
- 免责申明:本站内容均来源于网络,版权归原创所有,如有任何版权方面的问题,请与我们联系处理!