Paginated lists made really easy (part 2 of 2 - back-end)

In our first installment we reviewed the front-end part of developing a paginated list using AJAX and Java. Now we will dive into the back-end of our pagination mechanism.
More »

Download a file using Java

10-October-2008 | Tags: , , , , ,
Posted in Tips, Web related | No Comments »

Download a file using Java from a URL should be a simple task, well it is :P. If you just don’t want to think too much about it here is a sample method to do it.
More »

JarOutputStream problems on Windows

8-September-2008 | Tags: , ,
Posted in Tips | No Comments »

If you ever tried to create a JAR file from Java code using JarOutputStream on a Windows platform you might have become as frustrated as me. I ran into two problems and since they took a nice part of my sleep time I’ve decided to share them and the solutions I found.
More »

obov v1.1.0 released

4-August-2008 | Tags: , , , , ,
Posted in Security | No Comments »

A new version of obov is available for download. Some nice new features were added:

  • Methods to generate passwords using the HMAC-SHA1 algorithm
  • A handy utility method to generate secret keys (seeds) based on any given string

Go get it!

Read a file into a byte array

22-July-2008 | Tags: , ,
Posted in Tips | 2 Comments »

Need to read a file into a byte array in memory, here’s a simple code sample.
More »

obov v1.0.0 released

obov stands for OATH Based OTP validator. It’s a 100% pure Java library that provides simple to use methods to validate (and related utilities) one time passwords generated by OATH compliant devices.
More »

Paginated lists made really easy (part 1 of 2 - front-end)

You have to display a list of items in a web application, for each item allowing several operations (ie modification, deletion, etc.). The list can potentially be quite long, so pagination is required.
This scenario is common in backoffice web applications and public web sites, be it for administering information or as search results display, etc.

I’ll describe a simple way to implement a lightweight pagination engine that minimizes load on the server and gives the user the better experience possible. In this first installment I’ll focus on the front-end side, describing how to lay out the HTML, load it using AJAX and implementing the basic operations the user needs to navigate in your paginated list.
More »

Authenticate users using i5/OS (AS400) credentials

12-May-2008 | Tags: , , , , , ,
Posted in Security, Tips | No Comments »

The folks at IBM have a nice API to use i5/OS (AS400) stuff from Java code. Check it out at http://www-03.ibm.com/systems/i/software/toolbox/index.html.

What I particularly find very useful and have used often is to validate user names and passwords with the AS400 authentication services. The following code validates a userName and password.
More »

Very easy FIFO cache

2-May-2008 | Tags: , , ,
Posted in Performance, Tips | No Comments »

There are plenty of times when you need a cache for Java objects in your code. A very easy to use and simple implementation of a cache is provided with Apache ORO, wisely called CacheFIFO (http://jakarta.apache.org/oro/api/org/apache/oro/util/CacheFIFO.html).
More »

Authenticating users using Unix or Windows credentials

22-April-2008 | Tags: , , , , ,
Posted in Security, Tips | No Comments »

It’s usually very nice, and sometimes a requirement, to validate usernames and passwords using existing credentials. And in most situations big frameworks or single sign-on systems are just damn overkill and complex.

If you need to check your users credentials via an existing Unix system (that supports PAM) or a Windows domain controller check out More »