บทความ

กำลังแสดงโพสต์จาก ตุลาคม, 2014

Session Timeout In Servlet

The session timeout in a web application can be configurable in two ways 1) Timeout in the deployment descriptor (web.xml) – Specified the timeout value in “ minute ” , enclose with “session-config” element. <web-app ... > <session-config> <session-timeout> 20 </session-timeout> </session-config> </web-app> The above setting is apply for the entire web application, and session will be kill by container if client doesn’t make any request after 20 minutes. 2) Timeout with setMaxInactiveInterval() – You can manually specified the timeout value in “ second ” for a particular session. HttpSession session = request. getSession ( ) ; session. setMaxInactiveInterval ( 20 * 60 ) ; The above setting is only apply on session which call the “setMaxInactiveInterval()” method, and session will be kill by container if client doesn’t make any request after 20 minutes. Thoughts…. This is a bit confusing , the value in deployment ...

Sortable Update Hidden List Field

$ ( function () { $ ( ".sortColumn" ). sortable ({ connectWith : ".sortColumn" , placeholder : "portlet-placeholder" , update : function () { $ ( 'input.position' ). each ( function () { var parentID = $ ( this ). parent (). parent (). attr ( 'ID' ); $ ( this ). val ( parentID ); }); } }); $ ( ".sortColumn" ). disableSelection (); }); ที่มา :  Update Hidden List Field on jQuery UI Sortable?

Select defaul selected value

Given this HTML: <select> <option value = "0" > One </option> <option value = "1" > Two </option> </select> Select by description for jQuery v1.6+: var text1 = 'Two' ; $ ( "select option" ). filter ( function () { //may want to use $.trim in here return $ ( this ). text () == text1 ; }). prop ( 'selected' , true ); Select by description for jQuery versions below 1.6 and greater than or equal to 1.4 : http://stackoverflow.com/a/3644500/31532 var text1 = 'Two' ; $ ( "select option" ). filter ( function () { //may want to use $.trim in here return $ ( this ). text () == text1 ; }). attr ( 'selected' , true ); Note that while this approach will work in versions that are above 1.6 but less than 1.9, it has been deprecated since 1.6. It  will not work  in jQuery 1.9+. Select by description for previous versions: val() ...

testDSRMS

รูปภาพ

รวม Plugin

Bootstrap DataTable Bootstrap DataTable: Add rows Bootstrap DataTable: Delete Row Bootstrap DataTable: Highlighting rows and columns bootstrapvalidator : Validator Weareoutman : Clock Picker Eyecon : Date Picker Wenzhixin : Multiple-Select bootstrap ajax typeahead : ทำ Autocomplete x-editable