Time of Update: 2018-12-06
本人以前的這種需求都是用SpringSecurity實現,純配置,也沒怎麼考慮怎麼實現。今天朋友問我不用SpringSecurity怎麼實現,想了一下,覺得這樣可行,先記下,晚上試試。。。1.在applicationContext裡面方一個Map,key為賬戶id,value為session。2.使用者在登入的時候,利用contains()方法來判斷Map裡面是否已經包含了此id的key,如果包含了,從Map刪除此session,在將新的session放入。如果沒有直接放
Time of Update: 2018-12-06
如果出現如下錯誤,則可能是Hibernate SQL方言 (hibernate.dialect)設定不正確。Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]'last_insert_id' 不是可以識別的 函數名。 Hibernate SQL方言 (hibernate.dialect) ">RDBMS
Time of Update: 2018-12-06
Date.prototype.Format = function(fmt) { //author: meizz var o = { "M+" : this.getMonth() + 1, //month "d+" : this.getDate(), //day "h+" : this.getHours(), //hours "m+" : this.getMinutes(), //munutes "s+" : this.getSeconds(), //seconds "q+" :
Time of Update: 2018-12-06
訪問weblogic的一個頁面,頁面上出現一個錯誤:Error 404--Not Found From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:10.4.5 404 Not FoundThe server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or
Time of Update: 2018-12-06
在Spring整合 Hibernate中,對dao層訪問中提供了兩個操作。 (1)protected final Session getSession() throws DataAccessResourceFailureException,IllegalStateException;spring api的解釋: Obtain a Hibernate Session, either from the current transaction or a new one. The latter
Time of Update: 2018-12-06
Jetty和Tomcat為目前全球範圍內最著名的兩款開源的webserver/servlet容器。由於它們的實現都遵循Java Servlet規範,一個Java Web應用部署於兩款容器的任意一個皆可。但選擇哪個更優?也許這得看情境。 近期很多人關注Jetty,也許主要是因為GAE放棄了Tomcat而選擇了Jetty。於是,以很直接的想法,Jetty更符合GAE的需求、即雲環境的需求,亦分布式環境的需求。 那Jetty與Tomcat比較,有哪差異呢?
Time of Update: 2018-12-06
var pageValue=$("#input_iForm").formSerialize();var reg = /\s/g; //去字串所有空格 pageValue=pageValue.replace(reg, ""); var pici = $("#pici").val(); //批次 var remark = $("#remark").val(); //備忘var
Time of Update: 2018-12-06
/** * @param args */public static void main(String[] args) {// TODO Auto-generated method stubString ukey1="SZBSK00000000022";String ukey2="SZBSK00000000222";List a=getContinueString(ukey1,ukey2);for (Object object : a) {System.err.println(object);
Time of Update: 2018-12-06
如何避免測試盲區 測試盲區,也就是軟體中測試人員未測試到的地方,造成這方面的原因主要有測試人員對測試需求理解不足、經驗不足和思維僵化等原因造成的。接下來,就如何避免測試盲區給出幾點建議。一、 充分理解軟體需求
Time of Update: 2018-12-06
java.lang.UnsupportedClassVersionError: Bad version number in .class file 造成這種過錯的原由是Tomcat啟動並執行JDK版本與支撐application啟動並執行JDK版本不一致導致的. 那麼如何解決上面的問題呢? 措施顯而易見:把它們的JDK版本改成一致. 步驟如下: 1.Window --> Preferences -->Java --> compiler中的compiler compliance
Time of Update: 2018-12-06
1.下載axis2.war放到tomcat webapp下解壓,刪除war,以後的aar(或者直接用ant打jar更方便)放到\webapps\axis2\WEB-INF\services下2.配置axis2日誌在\webapps\axis2\WEB-INF\classes下log4j.rootLogger=DEBUG, console, logFile#DEBUG INFO WARN ERROR
Time of Update: 2018-12-06
$(document).ready(function(){var bro=$.browser;var binfo="";if(bro.msie) {binfo="Microsoft Internet Explorer "+bro.version;}if(bro.mozilla) {binfo="Mozilla Firefox "+bro.version;}if(bro.safari) {binfo="Apple Safari "+bro.version;}if(bro.opera)
Time of Update: 2018-12-06
測試目標VS品質目標VS測試依據VS測試原則 首先,測試目標≠品質目標≠測試依據≠測試原則可能有人會認為,測試目標就是發現軟體中的所有bug..事實上,那是不可能的,也是不負責人的。那是沒有考慮的時間成本等因素在內,即便如此,也是難以發現所有的bug的。所以,測試目標,應該是在有限的時間、人力、資源的投入下,發現出所有在軟體生命週期內對使用者有影響的問題!這樣來說,應該比較合理些。品質目標:不同公司的品質目標不太一樣,但基本無外乎在軟體生命週期內,能夠正常滿足使用者的使用,不出問題!測試依據,
Time of Update: 2018-12-06
讀取src下的屬性檔案的某個key值 /** * 讀取src下某個屬性檔案中的某個key所對應的value * * @param args * */ public static void main(String[] args) { String key = "file.upload.folder"; String propertiesFileFullName = "myProperty.properties";
Time of Update: 2018-12-06
儲存資料: AaaTest aaaTest = new AaaTest(); aaaTest.setId(id); aaaTest.setName(name); aaaTest.setAddress(address); this.baseDao.save(aaaTest); QueryHelper helper = new QueryHelper(); helper.append(" from AaaTest"); List<AaaTest> l = (List<
Time of Update: 2018-12-06
//begin---------------上下左右鍵控制if('${iscontrol_mchntid}'.indexOf('${mchntid}')!=-1){ var texts = new Array();//設定為focus所在的locationvar x = 2;var y = 3;var maxx = 0;var maxy = 0;window.onload=function(){var inputs = $("[location]");for(var i = 0; i <
Time of Update: 2018-12-06
@ManyToOne(fetch = FetchType.LAZY)出現懶載入異常:org.hibernate.LazyInitializationException: could not initialize proxy - no
Time of Update: 2018-12-06
文章目錄 2.1.執行個體12.2.執行個體2.2.1.執行個體12.2.執行個體2. JSONObject與JSONArray的使用1.JAR包簡介要使程式可以運行必須引入JSON-lib包,JSON-lib包同時依賴於以下的JAR包:commons-lang.jarcommons-beanutils.jarcommons-collections.jarcommons-logging.jar ezmorph.jarjson-lib-2.2
Time of Update: 2018-12-06
1.選擇java類型,會產生Long,hibernate只會產生long2.SEQUENCE主鍵 @Id@GeneratedValue(strategy = GenerationType.SEQUENCE,generator="role_seq")@SequenceGenerator(name="role_seq", sequenceName="SEQ_SYS_ROLES")@Column(name = "ID", unique = true, nullable = false,
Time of Update: 2018-12-06
關鍵字: json gson javaGson網址http://code.google.com/p/google-gson/ 1.簡單的處理list和map?1234567891011121314Gson gson = new Gson(); List testList = new ArrayList(); testList.add("first"); testList.add("second"); String listToJson = gson.toJson(testList);