亚洲国产午夜福利在线播放,亚洲综合色成在线播放,色欲色欲天天天www亚洲伊http://m.tkk7.com/cool2009/CommentsRSS.aspx專注于java相關技術.zh-cnTue, 17 Dec 2013 20:16:44 GMTTue, 17 Dec 2013 20:16:44 GMTcnblogsre: Struts1.2 驗證用戶是否登陸 兩種方法(轉)http://m.tkk7.com/cool2009/archive/2012/02/03/277926.html#369331v和vjv和vjFri, 03 Feb 2012 08:46:00 GMThttp://m.tkk7.com/cool2009/archive/2012/02/03/277926.html#369331

v和vj 2012-02-03 16:46 發表評論
]]>
re: jsp頁面通過 request對象直接獲取 struts2 Action的變量的值。http://m.tkk7.com/cool2009/archive/2011/12/15/266117.html#366421serisboyserisboyThu, 15 Dec 2011 04:27:00 GMThttp://m.tkk7.com/cool2009/archive/2011/12/15/266117.html#366421這個簡單實用!

serisboy 2011-12-15 12:27 發表評論
]]>
re: button/input鏈接方式全攻略http://m.tkk7.com/cool2009/archive/2011/10/24/264835.html#361865楊先生楊先生Mon, 24 Oct 2011 02:52:00 GMThttp://m.tkk7.com/cool2009/archive/2011/10/24/264835.html#361865

楊先生 2011-10-24 10:52 發表評論
]]>
re: Struts1.2 驗證用戶是否登陸 兩種方法(轉)http://m.tkk7.com/cool2009/archive/2011/06/02/277926.html#351612liangwuliangwuThu, 02 Jun 2011 09:25:00 GMThttp://m.tkk7.com/cool2009/archive/2011/06/02/277926.html#351612package 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(){}
}

liangwu 2011-06-02 17:25 發表評論
]]>
re: jsp中獲取前一個頁面的url包括參數http://m.tkk7.com/cool2009/archive/2011/05/13/278156.html#3501917u76tu7u76tuFri, 13 May 2011 09:38:00 GMThttp://m.tkk7.com/cool2009/archive/2011/05/13/278156.html#350191

7u76tu 2011-05-13 17:38 發表評論
]]>
re: jsp中獲取前一個頁面的url包括參數http://m.tkk7.com/cool2009/archive/2011/05/13/278156.html#3501907u76tu7u76tuFri, 13 May 2011 09:37:00 GMThttp://m.tkk7.com/cool2009/archive/2011/05/13/278156.html#350190

7u76tu 2011-05-13 17:37 發表評論
]]>
re: Struts1.2 驗證用戶是否登陸 兩種方法(轉)http://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349609liangwuliangwuThu, 05 May 2011 08:16:00 GMThttp://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349609
以上是自己一個web工程的filter。通過設置一個不被過濾的url集合notFilterURL,實現在struts1中沒有的interceptor所完成的功能。




liangwu 2011-05-05 16:16 發表評論
]]>
re: Struts1.2 驗證用戶是否登陸 兩種方法(轉)http://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349608liangwuliangwuThu, 05 May 2011 08:08:00 GMThttp://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(){}
}

liangwu 2011-05-05 16:08 發表評論
]]>
re: Struts1.2 驗證用戶是否登陸 兩種方法(轉)http://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349596liangwuliangwuThu, 05 May 2011 06:59:00 GMThttp://m.tkk7.com/cool2009/archive/2011/05/05/277926.html#349596

liangwu 2011-05-05 14:59 發表評論
]]>
re: 分享Java面試中遇到的一些經典算法題目http://m.tkk7.com/cool2009/archive/2010/07/31/268508.html#327666ttSat, 31 Jul 2010 14:14:00 GMThttp://m.tkk7.com/cool2009/archive/2010/07/31/268508.html#327666beginIndex>endIndex
這個是否沒用

t 2010-07-31 22:14 發表評論
]]>
re: 在jsp頁面判斷struts2 變量的值[未登錄]http://m.tkk7.com/cool2009/archive/2010/06/06/266478.html#322918yangyangSun, 06 Jun 2010 14:33:00 GMThttp://m.tkk7.com/cool2009/archive/2010/06/06/266478.html#322918

yang 2010-06-06 22:33 發表評論
]]>
re: Struts1.x中 bean:write format 屬性格式化輸出日期,數字(轉)http://m.tkk7.com/cool2009/archive/2009/12/16/268445.html#306114sdfsfsdfsfWed, 16 Dec 2009 03:03:00 GMThttp://m.tkk7.com/cool2009/archive/2009/12/16/268445.html#306114

sdfsf 2009-12-16 11:03 發表評論
]]>
re: struts2的ONGL標簽詳解(轉載)[未登錄]http://m.tkk7.com/cool2009/archive/2009/11/03/266477.html#300857三少三少Tue, 03 Nov 2009 02:49:00 GMThttp://m.tkk7.com/cool2009/archive/2009/11/03/266477.html#300857

三少 2009-11-03 10:49 發表評論
]]>
re: 文字連接用javascript 確認提示框 提示用戶是否要進行刪除操作http://m.tkk7.com/cool2009/archive/2009/10/26/265933.html#299736西鐵城西鐵城Mon, 26 Oct 2009 02:35:00 GMThttp://m.tkk7.com/cool2009/archive/2009/10/26/265933.html#299736

西鐵城 2009-10-26 10:35 發表評論
]]>
re: 分享Java面試中遇到的一些經典算法題目http://m.tkk7.com/cool2009/archive/2009/10/17/268508.html#298670yxyxSat, 17 Oct 2009 04:06:00 GMThttp://m.tkk7.com/cool2009/archive/2009/10/17/268508.html#298670

yx 2009-10-17 12:06 發表評論
]]>
re: java產生隨機數的幾種方式http://m.tkk7.com/cool2009/archive/2009/10/14/259882.html#298171GGWed, 14 Oct 2009 03:16:00 GMThttp://m.tkk7.com/cool2009/archive/2009/10/14/259882.html#298171

G 2009-10-14 11:16 發表評論
]]>
re: 分享Java面試中遇到的一些經典算法題目http://m.tkk7.com/cool2009/archive/2009/09/15/268508.html#295159萬其萬其Tue, 15 Sep 2009 07:52:00 GMThttp://m.tkk7.com/cool2009/archive/2009/09/15/268508.html#295159

萬其 2009-09-15 15:52 發表評論
]]>
re: 陳安之激勵名言十一句---分享給大家---學技術的同時思考一下人生[未登錄]http://m.tkk7.com/cool2009/archive/2009/08/13/266612.html#290992過客過客Thu, 13 Aug 2009 06:29:00 GMThttp://m.tkk7.com/cool2009/archive/2009/08/13/266612.html#290992

過客 2009-08-13 14:29 發表評論
]]>
re: 解決ajax post請求亂碼 ie、Firefox測試通過[未登錄]http://m.tkk7.com/cool2009/archive/2009/07/05/285299.html#285530lveyolveyoSun, 05 Jul 2009 01:56:00 GMThttp://m.tkk7.com/cool2009/archive/2009/07/05/285299.html#285530
而且response.serContentType("text/html;charset=utf-8");是設置返回數據的編碼類型的,和取得數據沒關系,應該用request.setCharacterEncoding("UTF-8");方法,也就不用轉碼了。

lveyo 2009-07-05 09:56 發表評論
]]>
re: 修改mysql root 密碼[未登錄]http://m.tkk7.com/cool2009/archive/2009/07/04/264251.html#285431小毅小毅Fri, 03 Jul 2009 18:08:00 GMThttp://m.tkk7.com/cool2009/archive/2009/07/04/264251.html#285431然后 出現Enter Password:讓你輸入舊密碼連接mysql數據進行更改
回車 更改密碼成功!


小毅 2009-07-04 02:08 發表評論
]]>
re: 解決ajax post請求亂碼 ie、Firefox測試通過[未登錄]http://m.tkk7.com/cool2009/archive/2009/07/04/285299.html#285430小毅小毅Fri, 03 Jul 2009 17:49:00 GMThttp://m.tkk7.com/cool2009/archive/2009/07/04/285299.html#285430或者自己手動轉碼new String(字符串.getBytes("原編碼方式"),"支持中文的編碼方式,如:UTF-8 GBK GB2312 GB18030")
亂碼問題老問題了。。哎。。。

小毅 2009-07-04 01:49 發表評論
]]>
re: 在jsp頁面判斷struts2 變量的值[未登錄]http://m.tkk7.com/cool2009/archive/2009/06/24/266478.html#283963小魚小魚Wed, 24 Jun 2009 08:39:00 GMThttp://m.tkk7.com/cool2009/archive/2009/06/24/266478.html#283963


小魚 2009-06-24 16:39 發表評論
]]>
re: 分享Java面試中遇到的一些經典算法題目http://m.tkk7.com/cool2009/archive/2009/06/03/268508.html#279739zdkzdkWed, 03 Jun 2009 01:30:00 GMThttp://m.tkk7.com/cool2009/archive/2009/06/03/268508.html#279739

zdk 2009-06-03 09:30 發表評論
]]>
re: jsp中獲取前一個頁面的url包括參數http://m.tkk7.com/cool2009/archive/2009/06/01/278156.html#279321racherracherSun, 31 May 2009 23:53:00 GMThttp://m.tkk7.com/cool2009/archive/2009/06/01/278156.html#279321

racher 2009-06-01 07:53 發表評論
]]>
re: jsp中獲取前一個頁面的url包括參數http://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279308lpz@21cn.comlpz@21cn.comSun, 31 May 2009 14:59:00 GMThttp://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279308

lpz@21cn.com 2009-05-31 22:59 發表評論
]]>
re: jsp中獲取前一個頁面的url包括參數http://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279250Sun, 31 May 2009 09:51:00 GMThttp://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279250

2009-05-31 17:51 發表評論
]]>
re: jsp中獲取前一個頁面的url包括參數http://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279120zhannglezhanngleSat, 30 May 2009 16:06:00 GMThttp://m.tkk7.com/cool2009/archive/2009/05/31/278156.html#279120

zhanngle 2009-05-31 00:06 發表評論
]]>
re: Struts1.2 驗證用戶是否登陸 兩種方法(轉)http://m.tkk7.com/cool2009/archive/2009/05/29/277926.html#278907zhongzhongFri, 29 May 2009 05:34:00 GMThttp://m.tkk7.com/cool2009/archive/2009/05/29/277926.html#278907

zhong 2009-05-29 13:34 發表評論
]]>
re: jsp中獲取前一個頁面的url包括參數[未登錄]http://m.tkk7.com/cool2009/archive/2009/05/28/278156.html#278357dydyThu, 28 May 2009 15:09:00 GMThttp://m.tkk7.com/cool2009/archive/2009/05/28/278156.html#278357

dy 2009-05-28 23:09 發表評論
]]>
re: jsp中獲取前一個頁面的url包括參數http://m.tkk7.com/cool2009/archive/2009/05/27/278156.html#278277劉杰劉杰Wed, 27 May 2009 15:16:00 GMThttp://m.tkk7.com/cool2009/archive/2009/05/27/278156.html#278277

劉杰 2009-05-27 23:16 發表評論
]]>
主站蜘蛛池模板: 亚洲午夜久久久影院伊人| 日本高清在线免费| 国产国产人免费视频成69大陆 | 中文字幕一区二区三区免费视频| 天天拍拍天天爽免费视频| 亚洲日本VA午夜在线影院| 午夜高清免费在线观看| 亚洲成av人片天堂网无码】| 无码日韩精品一区二区免费| 777亚洲精品乱码久久久久久 | 亚洲免费视频观看| 国产va精品免费观看| 91在线亚洲综合在线| 日韩在线免费电影| 无码日韩人妻AV一区免费l| 亚洲成人国产精品| 成在线人视频免费视频| 亚洲综合伊人久久综合| 日批视频网址免费观看| 亚洲欧洲日产国码一级毛片| 亚洲成人一级电影| 色影音免费色资源| 456亚洲人成影院在线观| aⅴ在线免费观看| 亚洲一级毛片在线播放| 免费观看无遮挡www的小视频| 亚洲毛片免费观看| 一个人免费视频观看在线www| 亚洲欧洲日产国码无码久久99| 18禁超污无遮挡无码免费网站 | 亚洲欧洲一区二区三区| 国产黄色片免费看| 亚洲AV无码第一区二区三区| 国内精品一级毛片免费看| 色婷婷六月亚洲婷婷丁香| 老司机精品免费视频| 亚洲免费日韩无码系列| 美女视频黄的免费视频网页| 色噜噜综合亚洲av中文无码| 最近的中文字幕大全免费版| 亚洲欧洲无码AV不卡在线|