我遇到过的问题

上学期期末写web作业的问题吧,

sevelet与jsp之间的传值问题:

在sevelet中重定向至jsp中,用同一个变量名来在不同的表单中读值 

type = "hidden" name  = "ID4" value = "${sign}"

 

还有一个sql注入漏洞的预防,就是过滤吧,

* 通过Filter过滤器来防SQL注入攻击

public class SQLFilter implements Filter {

private String inj_str = “‘|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare|; |or|-|+|,”;

protected FilterConfig filterConfig = null;

protected boolean ignore = true;

public void init(FilterConfig config) throws ServletException {

this.filterConfig = config;

this.inj_str = filterConfig.getInitParameter(“keywords”);

}

//对SQL注入最有效的防止,就是转义输入。

posted @ 2016-03-06 22:18  一边挖鼻屎一边  阅读(119)  评论(0编辑  收藏  举报