原创 leetcode 535. Encode and Decode TinyURL(長短網址互譯)

TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it

原创 異常:前端發送幾次請求後,瀏覽器一直等待localhost響應

前端頁面進行查詢操作幾次後,或者向後臺發送幾次請求之後瀏覽器一直顯示等待localhost響應 原因:數據庫傳送資源後沒有及時關閉,導致後面的數據傳送出現阻塞 解決方法:在次jdbc每次對數據庫進行操作後要及時關閉操作接口

原创 getAttribute和getParameter的區別

getAttribute:1.一般在前臺用與獲取後臺轉發值,返回的是Object,需進行轉換,可用setAttribute設置成任意對象;2.getAttribute表示從request範圍取得設置的屬性,必須要先setAttribute

原创 EL表達式和JSTL標籤庫

EL表達式:用於jsp頁面,獲取後臺的數據,或者後臺通過它獲取數據,簡便 在指定作用域中取得共享數據 ${pageScope.屬性名} 在page域取得數據,其他以此類推,requestScope、sessionScope、applic

原创 java內省機制

JavaBean:一種可重用的,遵循一定的設計規範的類 規範如下:1.類是public類型 2.有公告無參構造器 3.屬性私有,包含屬性的get、set方法 java內省機制:通過反射操作JavaBean的屬性,一般應用於框架底層 一

原创 異常:java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition

java.lang.ClassNotFoundException: org.hibernate.engine.FilterDefinition報錯 原因:spring和hibernate版本不對應 解決辦法:在bean配置文件中org

原创 異常:NoClassDefFoundError或Could not initialize class

相符加載到服務器的時候不能運行出現,使用第三方的包出現NoClassDefFoundError或Could not initialize class 原因:可能是編譯的時候沒問題,但是class運行時連接內存找不到,或者第三方jar包衝

原创 leetcode 46. Permutations(考全排列)

Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following pe

原创 請求轉發,請求包含,url重定向, ,區別

請求轉發: RequestDispatcher getRequestDispatcher(String path);//獲取請求分發器void forward(ServletRequest request,ServletResponse

原创 spring3整合hibernate4

resources.prioperties文件中有 db.driverClass=com.mysql.jdbc.Driver db.url=jdbc:mysql://localhost:3306/數據庫名 db.username=root

原创 spring3整合struts2

action名字中可以出現“/”,就要在struts2配置文件中配置struts.enable.SlashesInActionNames=true <constrant name="struts.enable.SlashesInActio

原创 ajax基礎 和 Jquery的ajax

ajax:通訊對象,瀏覽器的內置異步對象,默認情況下沒有被創建出來 IE中的對象叫ActiveXObject,高版本的ie才叫XMLHttpReques,兩者均可使用 其他瀏覽器叫XMLHttpRequest 判斷瀏覽器類型:網上搜吧 原

原创 異常:could not obtain transaction-synchronized

could not obtain transaction-synchronized 原因:配置文件沒配好,spring3整合hibernate4時,事務要交給spring管理,才能使用currentSession 不使用註解情況下,要在s

原创 通用dao寫法 (spring4+hibernate4),主要是反射泛型

通用Dao寫法1.定義BaseDao接口,IBaseDao<T>,定義了增刪查改方法;2.實現BaseDao接口,繼承HibernateDaoSupport ,有屬性sessionFactory;由於要使泛型T能夠實例化才能進行增刪查改方

原创 34.Search for a Range

Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.You