Home » Java (page 620)

Java

Low GC in Java: Use primitives instead of wrappers

Overview There are two good reason to use primitives instead of wrappers where possible. Clarity. By using a primitive, you are making it clear that a null value is not appropriate. Performance. Using primitives is often much faster. Clarity is often more important than performance, and is the best reason to use them. However, this article discussed the performance implications ...

Read More »

OSGi Using Maven with Equinox

I have struggled to understand what OSGi really means for a long time. It has been around since a very long time but not many people are aware of it. It has been hyped as a very complex technology to understand. Here is my attempt to make it simple for any Java developer. In short OSGi is a group of ...

Read More »

Java Pretty Good Privacy (PGP)

Public-Key Encryption This post talks about PGP or “Pretty Good Privacy.” PGP is a hybrid implementation of conventional cryptography as well as public key encryption. Before going into the details of PGP, let’s talk a little about public-key encryption. Like any other cryptographic technology, public-key encryption solves the problem of transmitting secure data over an insecure medium; namely, the internet. ...

Read More »

JavaFX 2.0 beta sample application and after thoughts

I had quite sometime back played around with JavaFX and had good and bad experiences using the language. With the JavaFX 2.0 beta being released I thought of giving it a try. Here, I developed a simple Geocoding application which will take the address and provides the latitude-longitude values for that location – using Google Geocoding API. I used Groovy ...

Read More »

Java Lambda Syntax Alternatives

The discussion on the lambda-dev mailing list has started to address the issue of what the Java language syntax for lambdas / function literals ought to look like. Let’s look at a slightly non-trivial example and try to tease the issues out. The Perl people have a nice example of something which uses function references in a somewhat functional way ...

Read More »

Apache CXF Load Balancing And Failover

A while ago we’ve faced the requirement of load-balancing web services clients based on Apache CXF. Also the clients should automatically fail-over when some of the servers are down. To make it even worse, the list of servers target addresses was to be obtained from external service and updated at runtime. Eventually we ended up with home-grown load-balancing micro-library (ESB/UDDI/WS-Addressing ...

Read More »

Hacking Jasper to Get Object Model of a JSP Page

java-interview-questions-answers

To perform some checks and statistical analysis on my JSPs I needed a DOM-like, hierarchical model of elements contained in them. But parsing JSP pages isn’t trivial and is best left to a tool that excels in it – the Jasper JSP compiler used by Tomcat, Jetty, GlassFish and likely also by all others. There is an easy way to ...

Read More »

Grow Up Java! Proposing Java Desktop Edition

No, this is not another ‘Java is Dead’ rant. Java is very much alive and kicking. It is one of the best development and runtime platform available. By far the most stable platform of those. And that might just be its biggest bane. Ridiculous! How is stability a bane? You might ask. Well, you can see the slow progress in ...

Read More »

SpringMVC 3 Tiles 2.2.2 Integration Tutorial

spring-interview-questions-answers

Apache Tiles is a popular and mostly used templating framework for java based web application. Tiles became more popular because Struts 1.x uses Tiles as its default templating framework. SpringMVC which is an MVC framework, like Struts, also supports integration of Tiles as its templating framework. Let us see how we can integrate SpringMVC and Tiles. You can download Tiles binaries from ...

Read More »