亚洲国产午夜福利在线播放,亚洲综合色成在线播放,色欲色欲天天天www亚洲伊 http://m.tkk7.com/cool2009/CommentsRSS.aspx專注于java相關技術. zh-cn Tue, 17 Dec 2013 20:16:44 GMT Tue, 17 Dec 2013 20:16:44 GMT cnblogs re: Struts1.2 驗證用戶是否登陸 兩種方法(轉) http://m.tkk7.com/cool2009/archive/2012/02/03/277926.html#369331v和vj v和vj Fri, 03 Feb 2012 08:46:00 GMT http://m.tkk7.com/cool2009/archive/2012/02/03/277926.html#369331 ]]>re: jsp頁面通過 request對象直接獲取 struts2 Action的變量的值。 http://m.tkk7.com/cool2009/archive/2011/12/15/266117.html#366421serisboy serisboy Thu, 15 Dec 2011 04:27:00 GMT http://m.tkk7.com/cool2009/archive/2011/12/15/266117.html#366421 這個簡單實用! ]]> re: button/input鏈接方式全攻略 http://m.tkk7.com/cool2009/archive/2011/10/24/264835.html#361865楊先生 楊先生 Mon, 24 Oct 2011 02:52:00 GMT http://m.tkk7.com/cool2009/archive/2011/10/24/264835.html#361865 ]]>re: Struts1.2 驗證用戶是否登陸 兩種方法(轉) http://m.tkk7.com/cool2009/archive/2011/06/02/277926.html#351612liangwu liangwu Thu, 02 Jun 2011 09:25:00 GMT http://m.tkk7.com/cool2009/archive/2011/06/02/277926.html#351612 package com.gpPlatform.utils;
/* 檢驗管理員是否已經登錄及是否擁有權限的過濾器*/
import java.util.List;
import java.util.Map;
import java.util.Iterator;
import java.util.Set;
import java.util.Date;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import com.gpPlatform.IConstants;
import com.gpPlatform.services.ResourceDao;
import com.gpPlatform.forms.AdminForm;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
public class SecurityCheckFilter implements Filter{
private List<String> notFilterURL;
private ResourceDao resourcedao= null;
private Map<String,String> permits;
private String getPermitId(String action_url){ //根據Map獲取動作資源id
this.permits= resourcedao.getResourceList();
String rid_visited="NO_MATCH";
Set<String> key = permits.keySet(); //獲取權限集map鍵集合
for(Iterator<String> it=key.iterator();it.hasNext();){
String k= it.next();
if(k.equals(action_url)){
rid_visited=permits.get(k);
break;
}
}
return rid_visited;
}
private boolean isPIdExist(AdminForm aform,String rid,boolean init){
boolean flag=!init;
if(!flag){
String[] pArray= aform.getPermitList();
for(String pid:pArray){
System.out.println(pid);
if(pid.equals(rid))
return true;
}
}
return flag;
}
public void init(FilterConfig filterconfig) throws ServletException{ //獲取系統context以傳遞屬性
String configpath= "F:/tomcat 5.5.2/Tomcat 5.5/webapps/gpplatform/WEB-INF/appContext.xml";
ApplicationContext context= new FileSystemXmlApplicationContext(configpath);
IConstants iconstant=(IConstants)context.getBean("constants");
resourcedao= (ResourceDao)context.getBean("resourcedao"); //不可setter直接注入,filter servlet容器先于spring生成
notFilterURL = iconstant.getNotFilterURL();
System.out.println("There are "+notFilterURL.size()+" urls free of filtering");
}
public void doFilter(ServletRequest req, ServletResponse res, //改寫doFilter方法檢驗
FilterChain chain)throws IOException, ServletException{
HttpServletRequest request= (HttpServletRequest) req;
HttpSession session= request.getSession();
AdminForm aform= (AdminForm)session.getAttribute(IConstants.CURR_ADMIN_KEY);
boolean flag1= true;
boolean flag2= true;
String str= request.getServletPath();
if(str.indexOf(".jsp")!=-1||str.indexOf(".do")!=-1){
for(String url:notFilterURL){
if(str.equals(url)){
flag1= false;
break;
}
}
}
else
flag1= false;
if(str.indexOf(".do")!=-1&&request.getParameter("method")!=null&&!request.getParameter("method").equals("readInfo"))
str += "?method="+request.getParameter("method"); //獲取一般的動作參數
else
flag2= false;
System.out.println("action str is "+str+" "+flag1+" "+flag2);
if(flag1){
if(aform==null){ //對不在免除過濾路徑集合中的url進行過濾
System.out.println("<=======You haven't Logged in yet!=======>"+(new Date()).toString());
request.setAttribute(IConstants.LOGIN_ERROR_KEY, "抱歉,您還沒有登陸本系統%>_<%");
request.getRequestDispatcher("/adminLog.jsp").forward(req, res);
}
else{
if(!this.isPIdExist(aform, this.getPermitId(str), flag2)){
System.out.println("<======You don't hava such permit!======>"+(new Date()).toString());
request.setAttribute(IConstants.PERMIT_ERROR_KEY,"抱歉,您不具備當前功能的權限⊙﹏⊙ ");
request.getRequestDispatcher("/errorPage.jsp").forward(req, res);
}
else{
chain.doFilter(req, res);
return;
}
}
}
else{
chain.doFilter(req, res);
return;
}
}
public void destroy(){}
} ]]> re: jsp中獲取前一個頁面的url包括參數 http://m.tkk7.com/cool2009/archive/2011/05/13/278156.html#3501917u76tu 7u76tu Fri, 13 May 2011 09:38:00 GMT http://m.tkk7.com/cool2009/archive/2011/05/13/278156.html#350191 ]]>re: jsp中獲取前一個頁面的url包括參數 http://m.tkk7.com/cool2009/archive/2011/05/13/278156.html#3501907u76tu 7u76tu Fri, 13 May 2011 09:37:00 GMT http://m.tkk7.com/cool2009/archive/2011/05/13/278156.html#350190 ]]>re: Struts1.2 驗證用戶是否登陸 兩種方法(轉) http://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349609liangwu liangwu Thu, 05 May 2011 08:16:00 GMT http://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349609
以上是自己一個web工程的filter。通過設置一個不被過濾的url集合notFilterURL,實現在struts1中沒有的interceptor所完成的功能。
]]> re: Struts1.2 驗證用戶是否登陸 兩種方法(轉) http://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349608liangwu liangwu Thu, 05 May 2011 08:08:00 GMT http://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349608 /* 檢驗管理員是否已經登錄的過濾器*/
import java.util.List;
import java.util.ArrayList;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
public class LoginCheckFilter implements Filter{
private static List<String> notFilterURL;
@SuppressWarnings("static-access")
public void init(FilterConfig filterconfig) throws ServletException{
this.notFilterURL= new ArrayList<String>();
notFilterURL.add("/gpplatform/adminLog.jsp");
notFilterURL.add("/gpplatform/errorPage.jsp");
notFilterURL.add("/gpplatform/testJDBC.jsp");
notFilterURL.add("/gpplatform/yzm.jsp");
notFilterURL.add("/gpplatform/script/trim.js");
}
public void doFilter(ServletRequest req, ServletResponse res,
FilterChain chain)throws IOException, ServletException{
HttpServletRequest request= (HttpServletRequest) req;
HttpServletResponse response= (HttpServletResponse) res;
HttpSession session= request.getSession();
boolean flag= true;
String str= "/gpplatform"+request.getServletPath();
for(String url:notFilterURL){
if(str.equals(url)){
flag= false;
break;
}
}
System.out.println(str+" "+flag);
if(flag&&session.getAttribute("curr_admin")==null){
//對不在notFilterURL集合路徑中的url進行過濾
System.out.println("<=====You haven't logged in!=====>");
response.sendRedirect("/gpplatform/adminLog.jsp");
}
else{
chain.doFilter(req, res);
return;
}
}
public void destroy(){}
} ]]> re: Struts1.2 驗證用戶是否登陸 兩種方法(轉) http://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349596liangwu liangwu Thu, 05 May 2011 06:59:00 GMT http://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349596 ]]>re: 分享Java面試中遇到的一些經典算法題目 http://m.tkk7.com/cool2009/archive/2010/07/31/268508.html#327666t t Sat, 31 Jul 2010 14:14:00 GMT http://m.tkk7.com/cool2009/archive/2010/07/31/268508.html#327666 beginIndex>endIndex
這個是否沒用 ]]> re: 在jsp頁面判斷struts2 變量的值[未登錄] http://m.tkk7.com/cool2009/archive/2010/06/06/266478.html#322918yang yang Sun, 06 Jun 2010 14:33:00 GMT http://m.tkk7.com/cool2009/archive/2010/06/06/266478.html#322918 ]]>re: Struts1.x中 bean:write format 屬性格式化輸出日期,數字(轉) http://m.tkk7.com/cool2009/archive/2009/12/16/268445.html#306114sdfsf sdfsf Wed, 16 Dec 2009 03:03:00 GMT http://m.tkk7.com/cool2009/archive/2009/12/16/268445.html#306114 ]]>re: struts2的ONGL標簽詳解(轉載)[未登錄] http://m.tkk7.com/cool2009/archive/2009/11/03/266477.html#300857三少 三少 Tue, 03 Nov 2009 02:49:00 GMT http://m.tkk7.com/cool2009/archive/2009/11/03/266477.html#300857 ]]>re: 文字連接用javascript 確認提示框 提示用戶是否要進行刪除操作 http://m.tkk7.com/cool2009/archive/2009/10/26/265933.html#299736西鐵城 西鐵城 Mon, 26 Oct 2009 02:35:00 GMT http://m.tkk7.com/cool2009/archive/2009/10/26/265933.html#299736 ]]>re: 分享Java面試中遇到的一些經典算法題目 http://m.tkk7.com/cool2009/archive/2009/10/17/268508.html#298670yx yx Sat, 17 Oct 2009 04:06:00 GMT http://m.tkk7.com/cool2009/archive/2009/10/17/268508.html#298670 ]]>re: java產生隨機數的幾種方式 http://m.tkk7.com/cool2009/archive/2009/10/14/259882.html#298171G G Wed, 14 Oct 2009 03:16:00 GMT http://m.tkk7.com/cool2009/archive/2009/10/14/259882.html#298171 ]]>re: 分享Java面試中遇到的一些經典算法題目 http://m.tkk7.com/cool2009/archive/2009/09/15/268508.html#295159萬其 萬其 Tue, 15 Sep 2009 07:52:00 GMT http://m.tkk7.com/cool2009/archive/2009/09/15/268508.html#295159 ]]>re: 陳安之激勵名言十一句---分享給大家---學技術的同時思考一下人生[未登錄] http://m.tkk7.com/cool2009/archive/2009/08/13/266612.html#290992過客 過客 Thu, 13 Aug 2009 06:29:00 GMT http://m.tkk7.com/cool2009/archive/2009/08/13/266612.html#290992 ]]>re: 解決ajax post請求亂碼 ie、Firefox測試通過[未登錄] http://m.tkk7.com/cool2009/archive/2009/07/05/285299.html#285530lveyo lveyo Sun, 05 Jul 2009 01:56:00 GMT http://m.tkk7.com/cool2009/archive/2009/07/05/285299.html#285530 而且response.serContentType("text/html;charset=utf-8");是設置返回數據的編碼類型的,和取得數據沒關系,應該用request.setCharacterEncoding("UTF-8");方法,也就不用轉碼了。 ]]>re: 修改mysql root 密碼[未登錄] http://m.tkk7.com/cool2009/archive/2009/07/04/264251.html#285431小毅 小毅 Fri, 03 Jul 2009 18:08:00 GMT http://m.tkk7.com/cool2009/archive/2009/07/04/264251.html#285431 然后 出現Enter Password:讓你輸入舊密碼連接mysql數據進行更改
回車 更改密碼成功!
]]> re: 解決ajax post請求亂碼 ie、Firefox測試通過[未登錄] http://m.tkk7.com/cool2009/archive/2009/07/04/285299.html#285430小毅 小毅 Fri, 03 Jul 2009 17:49:00 GMT http://m.tkk7.com/cool2009/archive/2009/07/04/285299.html#285430 或者自己手動轉碼new String(字符串.getBytes("原編碼方式"),"支持中文的編碼方式,如:UTF-8 GBK GB2312 GB18030")
亂碼問題老問題了。。哎。。。 ]]> re: 在jsp頁面判斷struts2 變量的值[未登錄] http://m.tkk7.com/cool2009/archive/2009/06/24/266478.html#283963小魚 小魚 Wed, 24 Jun 2009 08:39:00 GMT http://m.tkk7.com/cool2009/archive/2009/06/24/266478.html#283963 ]]>re: 分享Java面試中遇到的一些經典算法題目 http://m.tkk7.com/cool2009/archive/2009/06/03/268508.html#279739zdk zdk Wed, 03 Jun 2009 01:30:00 GMT http://m.tkk7.com/cool2009/archive/2009/06/03/268508.html#279739 ]]>re: jsp中獲取前一個頁面的url包括參數 http://m.tkk7.com/cool2009/archive/2009/06/01/278156.html#279321racher racher Sun, 31 May 2009 23:53:00 GMT http://m.tkk7.com/cool2009/archive/2009/06/01/278156.html#279321 ]]>re: jsp中獲取前一個頁面的url包括參數 http://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279308lpz@21cn.com lpz@21cn.com Sun, 31 May 2009 14:59:00 GMT http://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279308 ]]>re: jsp中獲取前一個頁面的url包括參數 http://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279250就 就 Sun, 31 May 2009 09:51:00 GMT http://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279250 ]]>re: jsp中獲取前一個頁面的url包括參數 http://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279120zhanngle zhanngle Sat, 30 May 2009 16:06:00 GMT http://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279120 ]]>re: Struts1.2 驗證用戶是否登陸 兩種方法(轉) http://m.tkk7.com/cool2009/archive/2009/05/29/277926.html#278907zhong zhong Fri, 29 May 2009 05:34:00 GMT http://m.tkk7.com/cool2009/archive/2009/05/29/277926.html#278907 ]]>re: jsp中獲取前一個頁面的url包括參數[未登錄] http://m.tkk7.com/cool2009/archive/2009/05/28/278156.html#278357dy dy Thu, 28 May 2009 15:09:00 GMT http://m.tkk7.com/cool2009/archive/2009/05/28/278156.html#278357 ]]>re: jsp中獲取前一個頁面的url包括參數 http://m.tkk7.com/cool2009/archive/2009/05/27/278156.html#278277劉杰 劉杰 Wed, 27 May 2009 15:16:00 GMT http://m.tkk7.com/cool2009/archive/2009/05/27/278156.html#278277 ]]>
主站蜘蛛池模板:
亚洲午夜久久久影院伊人 |
日本高清在线免费 |
国产国产人免费视频成69大陆
|
中文字幕一区二区三区免费视频 |
天天拍拍天天爽免费视频 |
亚洲日本VA午夜在线影院 |
午夜高清免费在线观看 |
亚洲成av人片天堂网无码】 |
无码日韩精品一区二区免费 |
777亚洲精品乱码久久久久久
|
亚洲免费视频观看 |
国产va精品免费观看 |
91在线亚洲综合在线 |
日韩在线免费电影 |
无码日韩人妻AV一区免费l |
亚洲成人国产精品 |
成在线人视频免费视频 |
亚洲综合伊人久久综合 |
日批视频网址免费观看 |
亚洲欧洲日产国码一级毛片 |
亚洲成人一级电影 |
色影音免费色资源 |
456亚洲人成影院在线观 |
aⅴ在线免费观看 |
亚洲一级毛片在线播放 |
免费观看无遮挡www的小视频 |
亚洲毛片免费观看 |
一个人免费视频观看在线www |
亚洲欧洲日产国码无码久久99 |
18禁超污无遮挡无码免费网站
|
亚洲欧洲一区二区三区 |
国产黄色片免费看 |
亚洲AV无码第一区二区三区 |
国内精品一级毛片免费看 |
色婷婷六月亚洲婷婷丁香 |
老司机精品免费视频 |
亚洲免费日韩无码系列 |
美女视频黄的免费视频网页 |
色噜噜综合亚洲av中文无码 |
最近的中文字幕大全免费版 |
亚洲欧洲无码AV不卡在线 |