struts2 interceptor
来源:互联网 发布:手机新软件 编辑:程序博客网 时间:2024/05/21 06:43
index.jsp
<body>
<form action="publis.action" method="post">
留言:
<textarea rows="6" cols="13" name="content"></textarea>
<br>
<input type="submit" value="提交">
</form>
publis.jsp
<body>
留言内容:<s:property value="content"/><br>
</body>
package action;
import com.opensymphony.xwork2.Action;
public class PublisAction {
private String content;
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public String execute() throws Exception {
return Action.SUCCESS;
}
}
package action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
public class PublisInterceptor extends AbstractInterceptor{
/**
*
*/
private static final long serialVersionUID = 1L;
@Override
public String intercept(ActionInvocation invocation) throws Exception {
Object object=invocation.getAction();
if(object instanceof PublisAction){
PublisAction publisAction=(PublisAction)object;
String content=publisAction.getContent();
publisAction.setContent(content.replaceAll("敏感字", "***"));
}
return invocation.invoke();
}
}
- Struts2---->interceptor
- Struts2 interceptor
- Struts2-Interceptor
- struts2 interceptor
- struts2 -- interceptor(Interceptor怎么写)
- struts2 -- interceptor(如何配置Interceptor)
- struts2 -- interceptor(如何配置Interceptor)
- struts2 -- interceptor(如何配置Interceptor)
- struts2 -- interceptor(如何配置Interceptor)
- struts2 -- interceptor(如何配置Interceptor)
- struts2 -- interceptor(如何配置Interceptor)
- Struts2拦截器(Interceptor)
- Struts2拦截器(Interceptor)
- struts2 拦截器 interceptor
- struts2 拦截器 interceptor
- Struts2拦截器(Interceptor)
- Struts2拦截器(Interceptor)
- Struts2拦截器(Interceptor)
- log4j
- oracle case when索引 空值索引 位图索引
- hdu1194
- hdu1259
- visual studio 解决方案项目结构部署和配置
- struts2 interceptor
- 格式化输入输出
- 非打印字符-转义序列
- 静态 与动态 (小探究)
- JavaBean
- hdu1395
- JSTL标签库
- 初学C++基本知识记录
- C++ 函数映射使用讲解