原创 讓絕對定位的元素居中

如果要問如何CSS實現絕對定位元素的居中效果,很多人心裏已經有答案了。 兼容性不錯的主流用法是: .element { width: 600px; height: 400px; position: absolute

原创 Access denied for user 'root'@'localhost' (using password:YES)。

這兩天在MyEclipse中開發Web項目時,連接MySQL數據庫,出現問題:Access denied for user ‘root’@’localhost’ (using password:YES)。 經查找資料發現是ro

原创 Spring使用Cache

       從3.1開始,Spring引入了對Cache的支持。其使用方法和原理都類似於Spring對事務管理的支持。Spring Cache是作用在方法上的,其核心思想是這樣的:當我們在調用一個緩存方法時會把該方法參數和返回結果作爲一

原创 MongoDB數據庫設計準則

1.嵌入式文檔 如果需要在其它文檔上下文(父文檔)查看某個數據,則選擇把該數據嵌入指定上下文中。 例如:在應用中,地址信息通常不是單獨顯示而是隨着個人信息一起顯示,在這種場景之下應該採用嵌入式文檔。 { _id: "joe",

原创 spring-dwr註解整合

註解配置 1.web.xml 只需將DwrServlet換爲DwrSpringServlet(包名不同) context-param> <param-name>contextConfigLocation</param-n

原创 全選/取消複選按鈕操作

DOCTYPE Html> <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"

原创 css中子元素浮動,無法自動撐開父元素的解決辦法

<div style="overflow:hidden;"> <div style="float:left;">left</div> <div style="float:right;">right</div> </div>

原创 SQL語句收集

1.將多個select語句的查詢結果合併 select * from (select top 3 * from users where account=’[email protected]’ UNION select top 2 * from use

原创 webSocket錯誤收集

關於 使用WebSocket報如下錯誤, Uncaught InvalidStateError: Failed to execute ‘send’ on ‘WebSocket’: already in CONNECTING state.