Postingan

Menampilkan postingan dari 2009

how to refresh a page periodecally using javascript

There are several ways to refresh a page in a given time period. Just try googling it, you'll find that several ways. This is how i refresh my page using javascript: <script language="Javascript"> setTimeout("refresh()",60000); function refresh() { // my function logic here setTimeout("refresh()",60000); } </script> This example refresh/re-call a function every 60 second, and it called recursively. I think this is quite simple to understand. So if you failed to refresh your page using some ways, try using this way. It works to me, and hopefuly for you too.. :) good luck!

jquery-autocomplete in struts2

Have you ever tried to use jQuery-autocomplete in Struts2 ? I used  jQuery  when I have to add an autocomplete feature on a textbox in my Struts2 project. The textbox should display the existing tags on the textbox, so users could choose any tag displayed by the autocomplete feature. If you want to try an example of jquery-autocomplete, go check it out on  this link . You'll also find the demo link on that page. Here are my steps to implement autocomplete in my project: Create a method to get the existing tags from database. ..... ..... public String findTag() {   listTag = daoFactory.getTagDAO().findTagList();   return SUCCESS; } ..... ..... Create a JSP that displays the list of existing tags, called tag.jsp <%@ taglib prefix="s" uri="/struts-tags"%> <s:iterator value=&qu

making your own license with Netbeans

Gambar
Kebanyakan code program ada tulisan lisensi dibagian atas program (sebut saja header). Biasanya lisensi itu menuliskan pernyataan kalo program itu ga boleh di-copy sembarangan tanpa seijin sang programmer, atau tulisan sejenisnya itu lah. Nah, mari kita belajar bagaimana menjadikan sebuah lisensi sebagai default header dari setiap program yang kita buat :) oia, bahasa yg dipake disini Java dan IDE nya Netbeans. Baiklah, mari kita mulai... yg pertama, buka Netbeans donk pastinya.. Lalu klik menu Tools dan pilih Templates . Seperti gambar dibawah ini: kalau benar, pasti akan keluar window seperti ini: seperti gambar diatas, pilihlah "Default License" dari folder "Licenses", lalu klik tombol "Open in Editor". Nah, skarang akan muncul seperti gambar dibawah ini: bagian ini lah yang akan di-edit menjadi default lisensi dari setiap class. Misalnya saja kuedit jadi seperti ini: baris ke-4 dari {licensePrefix} itu merupakan fungsi untuk menulis tanggal. Jadi tan