Tag: jsp
Super simple AJAX for Java apps using JQuery and JSON
by ricardoz on Oct.28, 2009, under Articles, JavaScript, Web related
Back in April I wrote about Java to/from JSON serialization using XStream. After developing several AJAX applications using PHP and JQuery, I found that for a lot of scenarios a very simple approach is not only easy but very effective. In the case of PHP, you can effectively enable AJAX in your apps using jQuerys $.getJSON() and PHP json_encode().
I think we can use a very similar approach for Java web applications, enabling the use of AJAX through a very simple, elegant and extensible architecture, without the use of complex frameworks and extra configurations.
(continue reading…)
Obovweb source code – a Google Appengine sample
by ricardoz on Oct.20, 2009, under Security, Tips, Web related
Someone asked me about the implementation details of the Google Appengine sample I published a few weeks ago (http://obovweb.appspot.com/). Well, you can get a hold of the source code here.
There’s not much to tell, apart from the specific HMAC-SHA1 implementation (which you can check out in Obovs source code) it’s a very simple JSP/DWR application.
AJAX autocomplete
by ricardoz on Apr.17, 2008, under JavaScript, Tips, Web related
Using a nice AJAX auto completable input box is much nicer (for the user) than a combo box with 100 options. If you use jQuery, you may use a quite easy yet powerful plug-in called jquery.autocomplete (original, eh?). Grab it at http://www.pengoworks.com/workshop/jquery/autocomplete.htm.
(continue reading…)
Keep it simple!
by ricardoz on Apr.06, 2008, under Performance, Tips
Do you really need to have a database table with all existing countries? What’s the benefit? Apart from adding one more database query to each page hit and an array to each users context while loading that form…
Think it over, every software component’s goal must be, first of all, to satisfy the users needs as fast and as reliably as possible. Considering the “fast” part, you must always evaluate if it’s really necessary to store this kind of info in a database table, and penalize the applications overall performance by adding another database query, recordset run through and a whole bunch of new objects in an array in request or session context.
Long fields breaking your HTML?
by ricardoz on Apr.06, 2008, under Tips, Web related
I guess in more than one time you needed to display some text in a space where it not always will fit. For example graphical designers love to lay out lists and tables and purposely forget about how long each field will really be ;)
A solution I like is to display always a fixed number of characters and add the full text as a title (mouse over display). A really easy way to do this is using the substring function from the JSTL functions library, for example:
1 2 3 | <span title="${myBean.myProp}">
${fn:substring(myBean.myProp,0,25)}
</span> |