日期:2014-05-17 浏览次数:20832 次
jQuery(document).ready(function() {
jQuery("#menulist").jqGrid( {
url :"menuAction_viewMenu.action",// 这里的url 断点不走方法
datatype : "json",
mtype : "post",
<package name="basePackage" extends="json-default">
<interceptors>
<interceptor name="keywordInterceptor" class="zyzy.common.interceptor.KeywordInterceptor"/>
<!-- 异常处理拦截器 -->
<interceptor name="exceptionInteceptor"
class="ExceptionInteceptor">
<param name="exceptionDisplay">exceptionDisplay</param>
</interceptor>
<!-- 定义异常拦截器栈 -->
<interceptor-stack name="exceptionStack">
<interceptor-ref name="defaultStack"></interceptor-ref>
<!-- <interceptor-ref name="exceptionInteceptor"></interceptor-ref> -->
<interceptor-ref name="keywordInterceptor">
</interceptor-ref>
</interceptor-stack>
</interceptors>
<!-- 定义默认拦截器 -->
<default-interceptor-ref name="exceptionStack" />
<!--定义全局输出结果 type="redirect" -->
<global-results>
<result name="info">/common/info.jsp</result>
<result name="timeOut">
/common/exception.jsp
</result>
<result name="exceptionDisplay">
/common/exception.jsp
</result>
</global-results>
<!-- 异常处理 -->
<global-exception-mappings>
<exception-mapping result="exceptionDisplay"
exception="zyzy.common.exception.BaseException">
</exception-mapping>
</global-exception-mappings>
public class KeywordInterceptor extends AbstractInterceptor{
private final static String [] KEYWORD_MYSQL = {"|",";","$","%","@","'"," ","<>","()","","//+","CR","LF",",",".","document","eval","or","and","exec ","call ","insert ","select ","delete ",
"exe","update ","master","truncate ","declare ","#","java",
"drop ","create ","<script","/script>","iframe"};
@SuppressWarnings({ "rawtypes", "unchecked" })
public String intercept(ActionInvocation actionInvocation) throws Exception {
Map params = actionInvocation.getInvocationContext().getParameters();
if(params.size() > 0){
Iterator iterator = params.entrySet().iterator();
String temp_str;
Map.Entry temp;
int zCount = 0;
boolean test = false;
Map tempMap = new HashMap();
while(iterator.hasNext()){
temp = (Map.Entry)iterator.next();
if(temp.getValue() instanceof String)
temp_str = temp.getValue().toString();