Try with resources is a new feature in Java 7 which lets us write more elegant code by automatically closing resources like FileInputStream at the end of the try-block.
|
||||||
|
Try with resources is a new feature in Java 7 which lets us write more elegant code by automatically closing resources like FileInputStream at the end of the try-block.
One of the new features added in Java 7 is the capability to switch on a String. See an example of how to use this feature and the pros of this feature.
While you can download the binaries for Java 7 for Windows and Linux, you need to go through a tedious build and install instructions for Mac OS X. This article links to the official Mac OS X Java 7 instructions, and also lists some things that are likely to go wrong and how to avoid them.
Overview If you use JBoss Tools Plugin for Eclipse to deploy apps to JBoss 5.1 container and get a “SeamListener not found”, this post provides a simple workaround. I deployed a webapp to JBoss 5.1 container from Eclipse using JBoss Tools plugin. The app failed to start with the following error: 19:01:14,762 WARN [JAXWSDeployerHookPreJSE] Cannot [...]
This articles describes how to secure a Java web application in JBoss using BASIC authentication.
While parsing an XML file, I discovered that www.w3.org blocks requests to certain resources originating from the Java program, identified by the User-Agent. If your XML refers to w3.org DTDs, you might see an error like this: [java.io.IOException: Server returned HTTP response code: 500 for URL: http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent]. This is a known issue. The URLs have been deliberately blocked by w3.org due to ‘abusive’ use by Java programs.
Read how to set expiry date HTTP Header in Java webapps via configuration file without writing any code. This article shows you how to speed up your Java webapp by setting optimal expiration dates on your Java web pages.
Add cronjob like capability to Java web applications in 4 simple steps using Spring and Quartz. This article outlines the steps needed for scheduling, with code snippets for each step.
This article demonstrates how to read and write bar codes from a Java program. We use the open source library “zxing” which supports many different types of bar code including the 2D QRCode, used by mobile apps. It can even read a barcode embedded somewhere in the page in a busy text document.
This article describes how to display the version of your maven project in your web application.
|
||||||
|
Copyright © 2012 Vineet Manohar's blog - All Rights Reserved
|
||||||