บทความ

กำลังแสดงโพสต์จาก พฤศจิกายน, 2014

Jackson confused with bidirectional one-to-many relationship

I'm using jackson 1.9.2 with Hibernate/Spring MVC through MappingJacksonHttpMessageConverter. Jackson can not serialize bidirectional one-to-many relationship and makes an infinite loop. The classes I'm using are : Conversation which has a Set of SMS instances. Each SMS instance has a Set of PhoneNumbers Each PhoneNumber has a parent contact (this is the bidirectional many-to-one relationship) What I am trying to do is to serialize a conversation. If I don't use  @JsonManagedReference  and  @JsonBackReference  then jackson will crashe due to an infinite loop. But when I use them, the  Contact  doesn't get serialized into the  PhoneNumber . Class Contact { @JsonManagedReference List<PhoneNumber> phoneNumber ; } Class PhoneNumber { @JsonBackReference Contact contact; } The output is : { <--------------------- Conversation "id": 51, "smsSet": [ { "id": 53, "origin...

รวบรวม JAVA

JAVA String Format Convert String To Date Formatting Numeric Print Output JSTL <fmt:formatDate> Tag

รวบรวม .NET C#

001_ASP.NET(C#) การใช้งาน SqlDataReader กับ GridView 002_ASP.NET(C#) การเพิ่มข้อมูลลง Database ด้วยแบบ statement prepare 003_วิธีการอัปโหลดแฟ้มไปยังเว็บเซิร์ฟเวอร์ใน ASP.NET โดยใช้ Visual C# .NET 004_Foreach C# การวนลูปด้วยคำสั่ง foreach 005_Session ASP.NET C# การใช้งาน Session ASP.NET C# 006_Multiple File Upload ASP.NET C# การอัพโหลดรูปภาพแบบหลาย ๆ รูป 007_Upload รูปภาพ ASP.NET C# ด้วยคำสั่ง SaveAs 008_การอ้างอิง Controls จาก Parent Page ไปยัง Web User Control Form 009_ADO.NET Architecture 010_try, catch และ finally 011_การใช้งาน ASP.NET กับ Server & Client

รวบรวม SQLServer

โหลด SQL Server 2012 วิธีการติดตั้ง SQL Server Management Studio 2012 วิธีการสร้าง relationship diagram วิธีแก้ : แก้ไขตารางแล้ว save ไม่ได้ ต้องสร้างใหม่ - Saving changes is not permitted in SQL Server Management Studio SQL Server CONVERT() Function

รวบรวม Jquery

Jquery Download วิดีโอสอนพื้นฐานของ HTML CSS Javascript จาก Google sites.google.com/site/ntaweera/javascript document.write Javascript คืออะไร และวิํธีการใช้งาน window.history.back Javascript การย้อนกลับไปยังหน้าที่ผ่านมา การดักจับกดปุ่ม Enter Javascript ความแตกต่างของ .bind(), .live(), และ .delegate() isNaN(value); ใช้เช็คค่าว่าเป็นตัวเลขหรือไม่เป็น return เป็น true /false ajax post() และ get() jQuery การประยุกต์ใช้ AJAX ด้วย post() และ get() Ajax ง่ายๆ กับ jQuery Dialog Confirm select default selected value select readonly radio checked by value radio check/uncheck วิธีแก้ Datepicker Clone append element after first child get current date jquery.serializeJSON รวม plugin gallery slider รวม plugin gallery slider

รวบรวม Javascript

The History Object : ทำปุ่ม back, forward, go Window confirm() Method : alert confirm Substring

รวบรวม CSS

LESS CSS สอนเทคนิคเทพที่จะเปลี่ยนการเขียน CSS ของคุณ SASS คืออะไร? เทคนิคช่วยให้การเขียน CSS เป็นเรื่องง่าย ๆ ใช้กันทั่วโลก !!

รวบรวม Html

HTML Introduction  HTML Basic HTML Formatting HTML Comments HTML Attributes HTML Head HTML CSS HTML Links HTML Images HTML Tables HTML Lists HTML Forms HTML Iframe HTML Colors HTML Entities HTML Layout

รวบรวม JAVA Spring Framework

ตอนนี้ผมได้รับงานใหม่มาครับเป็นระบบเกี่ยวกับการจัดการอบรม โดยระบบนี้จะใช้ JAVA Spring Framework ซึ่งผมไม่เคยเขียนมาก่อน ผมเลยตั้งใจจะเขียน blog ไว้เพื่อเอาไว้ดูเองกันลืม และเพื่อเป็นการแบ่งปันให้เพื่อนๆที่สนใจกันนะครับ ต้องออกตัวก่อนนะครับ blog ผมไม่ค่อยได้เขียนพึ่งมาจับมือใหม่อะไรประมาณนั้น อาจจะใช้ภาษาอะไรไม่เหมาะสมบางก็ ประกอบกับผมพึ่งมาจับ JAVA ด้วยผิดพลาดประการใดก็ขขออภัยไว้นะที่นี้เลยละกัน ปล. แต่จะพยายามทำให้ดึที่สุดละกัน เริ่มเลยดีกว่า Project : Training League : JAVA Framework : Spring Framework Editor Tool : Netbean 8 DB : MS SQL SERVER รวม link คำสั่ง Netbean ที่ใช้บ่อย สร้าง Project ใหม่ใน Netbean Spring Framework ไฟล์ต่างๆไว้ทำอะไรบ้าง สร้าง Connction ให้ Netbean มันคุยกับ Database ซะหน่อย สร้าง Entity จาก Database เดียวมาต่อนะ link อื่น Spring MVC Framework : เริ่มต้นเขียนเว็บกับ Spring MVC Framework กันเถอะ ตอนที่ 2 Spring MVC Upload File Using jQuery.ajax | FormData | HTML Form

รวบรวม App Android น่าใช้

3-launchpad Cloud Music Player : ฟังเพลงผ่าน cloud

รวม Plugin Wordpress

Plugin SZ - Google for WordPress : รวม Google Facebook : รวม Facebook Page Builder by SiteOrigin : แบ่ง Layout Page Builder by WooRockets.com : แบ่ง Layout ดึงรูปจาก google drive มาแสดงในเว็บ   ดึงรูปจาก google drive มาแสดงในเว็บ : Google Drive Media Library เพิ่มปุ่มในหน้าเขียนโพส สำหรับใส่วีดิโอจากเว็บไซต์ดังๆ เอาไว้หาภาพจาก Flickr ที่มีลิขสิทธิ์แบบ Creative Commons ในการแปะบนเว็บ Portfolio Gallery ทำเว็บ 2 ภาษา 7 ปลั๊กอิน Hot ที่จำเป็น สำหรับ Wordpress พร้อมวิธีการติดตั้งเเละวิธีการใช้งานอย่างละเอียด http://wpdemo.web-dorado.com/spider-facebook/ Plugin Wordpress : สมัครสมาชิกใหม่ Login With Ajax Plugin Wordpress : ใช้เปลี่ยนเว็บเป็นภาษาไทย (Codestyling Localization) สรุปความรู้เทพ ๆ จากงาน WordPress Developer Night 3 !! List of the Best and Must Use WordPress Plugins

วิธีแสดงบทความแยกตามป้ายกำกับพร้อมรูปภาพ

credit : http://4x100utd.blogspot.com/2013/06/blog-post_20.html

รวบรวมลิงก์

ของตกแต่งเว็บ background google style generator google map api Bootstrap ของแต่ง bootstrap Generator Tool : www.layoutit.com Generator Tool : shoelace Jquery Plugin Unite Gallery UML Driagram Tool umlet Database Editor Tool dbschema Toadworld SQLyog Tool : เครื่องมือ get CSS Jsoneditoronline Photo Editor : ตัดแต่งรูปภาพ Color Editor : หาค่าสี Color Code : รหัสสี Color Code : รหัสสี CSS3 Genarator CSS3 Genarator CSS Menu Generator : ออกแบบเมนู Google Developer วาดรูปบนเว็บ Font Test : ทดสอบตัวอักษร รวม tool ajax-loader.gif รวมไฟล์ PDF Free Templates http://www.jqueryrain.com/freetemplates/ http://speckyboy.com/2014/05/16/free-bootstrap-admin-themes/ http://daveismyname.com/free-bootstrap-admin-themes-bp#.VHvNWDGUeCl http://www.cssauthor.com/bootstrap-admin-templates/ https://github.com/bopoda/ace Web Bootstrap jquery.com w3schools.com thaicreate.com javathailand.com Blogger http://www.haakblog.com/ ...

Hibernate HQL : หาค่า id

public int MaxIdenx () { int max = ( Integer ) session . createQuery ( "SELECT COALESCE(MAX(empId), 0) FROM Emp" ) . uniqueResult (); return max + 1 ; } credit : http://stackoverflow.com/questions/13468276/how-to-use-syntax-of-mysql-such-as-ifnullmaxid-0-in-hibernate

Using Ajax to submit the form

credit : http://bootstrapvalidator.com/examples/ajax-submit/

การประยุกต์ใช้คำสั่ง .serialize()

credit : http://www.select2web.com/jquery/jquery-serialize-usage.html

Iframe with 100% Height

Ever wonder how to create an iframe that fills the entire height (and width) of a page? You probably tried writing something like:  < iframe   width = 100 %  height = 100 % ></ iframe >  and expected the iframe to fill up whatever it could. The  width = 100 %  does what you expected and fills up the entire width of the page, but the height just stays about 200px. Here's some easy JavaScript to do exactly this: Put this in the head of your page: < script language = "JavaScript" > <!-- function resize_iframe () { var height = window . innerWidth ; //Firefox if ( document . body . clientHeight ) { height = document . body . clientHeight ; //IE } //resize the iframe according to the size of the //window (all these should be on the same line) document . getElementById ( "glu" ). style . height = parseInt ( height - document . getElementById ( "glu" ). offsetTop - 8 )+ "px" ; } // this will resize the iframe eve...

plugin bootstrapvalidator : resetForm

credit : http://bootstrapvalidator.com/examples/modal/#html5

Change Form Action

$( "#myform" ).attr( 'action' , 'yourpage.html' ); credit : http://www.infotuts.com/change-form-action-based-select-option-using-jquery/

jQuery getJSON

Description: The  jQuery.getJSON( url, [data], [callback] )  method loads JSON data from the server using a GET HTTP request. The method returns XMLHttpRequest object. Syntax: Here is the simple syntax to use this method: $ .getJSON( url, [data], [callback] ) Parameters: Here is the description of all the parameters used by this method: url : A string containing the URL to which the request is sent data: : This optional parameter represents key/value pairs that will be sent to the server. callback: : This optional parameter represents a function to be executed whenever the data is loaded successfully. Example: Assuming we have following JSON content in /jquery/result.json file: { "name": "Zara Ali", "age" : "67", "sex": "female" } Following is a simple example a simple showing the usage of this method: <html> <head> <title>the title</title> <script type=...

Jquery to change form action

$ ( '#button1' ). click ( function (){ $ ( '#myform' ). prop ( 'action' , 'page1.php' ); });