Tag Archives: Java

Data tables in JSF

Data table is one of the most advanced UI components provided by JSF. This component is used to represent data in a table form and can contain multiple rows and columns and optionally header, footer and caption. In this post … Continue reading

Posted in Java, Java EE, JSF | Tagged , , , , | 4 Comments

Parameterized unit tests in JUnit

Sometimes you may want to execute a series of tests which differ only by input values and expected results. Instead of writing each test separately, it is much better to abstract the actual tests into a single class and provide … Continue reading

Posted in Java, Software development practices | Tagged , , | 2 Comments

Evaluating postfix expressions

The standard notation used to represent mathematical expressions is called infix notation. You should be very familiar with it already because it is almost exclusively used in books and thought in schools. Just to be clear, the typical example of … Continue reading

Posted in Algorithms, Java | Tagged , | 4 Comments

Custom bean validation constraints

Bean Validation API defines several built-in constraint annotations which are very useful in many situations. However, there are still some cases where these standard constraints are not enough and you have to create your own custom constraint. With Bean Validation … Continue reading

Posted in Java, Java EE, Spring | Tagged , , , | 5 Comments

Common exception misuses in Java (and not only)

Exceptions were introduced in many programming languages as a standard method to report and handle errors. If you have ever used functions that return special values (usually -1 or NULL) to indicate an error, you should know how easy it is … Continue reading

Posted in Java, Software development practices | Tagged , | 7 Comments

Views in Java Collections Framework

View in Java Collections Framework is a lightweight object which implements Collection or Map interface but is not a real collection in a traditional sense. In fact, view does store objects inside but references another collection, array or a single … Continue reading

Posted in Java | Tagged , | 1 Comment

Validating HTML forms in Spring using Bean Validation

Validating input is a crucial part to ensure data integrity and proper function of the whole application. JSR-303 also known as Bean Validation is a very convenient way to perform such validation at different levels of the application. In this … Continue reading

Posted in Java, Spring | Tagged , , | 4 Comments

How to handle HTML forms in Spring

Spring MVC is a part of Spring Framework which main purpose is to simplify development of web applications. In this article I would like to explain how to handle HTTP requests, render the web page and process simple HTML forms … Continue reading

Posted in Java, Spring | Tagged , , , , , , | 6 Comments

Recursively walking directory using Java NIO

Sometimes you may need to recursively visit all files and subdirectories of given directory and perform some actions on it. The typical use case is searching files of a given type, copying or removing a directory including all its contents. … Continue reading

Posted in Java | Tagged , , | 4 Comments

Calculating cryptographic hash functions in Java

Cryptographic hash function is an algorithm which takes block of data of arbitrary length as an input and outputs a short fixed-length sequence of bits (usually 128-512 bits) and which ideally should have following properties: it is very easy to … Continue reading

Posted in cryptography, Java | Tagged , , , , | Leave a comment