ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button

ONJava.com Articles

1 to 50 of 810 Next

Introducing [fleXive] - A Complementary Approach to Java EE 5 Web Development
By Markus Plesser
This article is an introduction to Flexive, an open source Java EE 5 application development stack. The authors have extracted a complete application template and describe its use. May. 1, 2008

Introducing Raven: An Elegant Build for Java
By Matthieu Riou
Build processes in Java haven't evolved much since the introduction of Ant or Maven. With the ability to use scripting languages like Groovy and JRuby on the JVM, the power of a full language can be brought to bear on the build process. This article discusses Raven, a build system for Java that uses JRuby. Dec. 5, 2007

Using XML and Jar Utility API to Build a Rule-Based Java EE Auto-Deployer
By Colin (Chun) Lu
In this article Colin (Chun) Lu discusses some of the complexities facing a large-scale J2EE application and demonstrates a rules-based Java Enterprise Edition auto-deployer using XStream and the JAR Utility API. Nov. 16, 2007

Introduction to Amazon S3 with Java and REST
By Eric Heuveneers
S3 is a file storage and serving service offered by Amazon. In this article, Eric Heuveneers demonstrates how to use Amazon S3 via its simple REST API to store and serve your own documents, potentially offloading bandwidth from your own application. Nov. 8, 2007

Schemaless Java-XML Data Binding with VTD-XML
By Jimmy Zhang
This article introduces a Java-XML binding technique based on VTD-XML and XPath. This approach doesn't mandate a schema, takes advantage of XML's inherent loose encoding, and avoids needless object creation, so it is much more efficient for lightweight data binding. Sep. 10, 2007

Esper: Event Stream Processing and Correlation
By Thomas Bernhardt
Event-driven architectures turn a traditional data-driven application's architecture upside-down. Instead of storing the data and running queries against stored data, Esper allows applications to store queries and run the data through. This article introduces Esper, a lightweight event processing kernel written in Java. Mar. 8, 2007

An Introduction to Hibernate 3 Annotations
By John Ferguson Smart
Hibernate is just about the defacto standard for Java database persistence. With Hibernate 3, it has become even easier to specify how your Java objects are stored in a database. In this article, John Smart shows how Java 5 annotations are used by Hibernate to simplify your code and make persisting your data even easier. Feb. 8, 2007

Tuning Derby
By Dejan Bosanac
Derby is a popular choice for an all-Java open-source database, but like all databases, it requires thought and care to run at ideal efficiency. Dejan Bosanac shows techniques--many of them applicable to all JDBC databases--that will keep your Derby-backed application running at top speed. Jan. 31, 2007

Java Web Development with Stripes
By Mark Eagle
Convention-over-configuration is the battle cry of popular web frameworks like Ruby on Rails, and Stripes brings the same kind of thinking to Java. In this article, Mark Eagle shows how to put together a basic Stripes framework and discusses the framework's integration with Ajax and Spring. Jan. 24, 2007

Building Enterprise Services with Drools Rule Engine
By Birali Hakizumwami
Weaving complex business logic into application code makes developers deeply responsible for understanding and maintaining that logic, and means that every change in a company's processes requires a recompile and redeploy. Using a rules engine like Drools offers an opportunity to split the rules into their own files, potentially editable by the subject-matter experts instead of developers. Birali Hakizumwami shows how this approach can be made to work for financial applications like mortgage underwriting systems.  Jan. 17, 2007

Discovering a Java Application's Security Requirements
By Mark Petrovic
Java security manager policy files are powerful and flexible, but rather grueling and error-prone to write by hand. In this article Mark Petrovic employs a novel approach: a development-time SecurityManager that logs your applications' calls and builds a suitable policy file. Jan. 3, 2007

Review/Preview: 2006 and 2007 in Java
By Chris Adamson
2006 will be remembered as the year that Sun open-sourced Java under the GPL, that EJB 3.0 finally shipped, and that Google surprised everyone with its Google Web Toolkit. But how will history record the results of these events? For the 2006 year-ender, ONJava editor Chris Adamson looks at the year's events through the lens of how they may play out in 2007. Dec. 20, 2006

Migrating to Spring
By Q Ethan McCallum
Sure, everyone's been talking up Spring for the last year or so, but what if your app already uses some other framework, or if you didn't even use a framework and instead rolled your own JDBC and DAOs? Ethan McCallum has a case study showing how he took a web application written for another article and converted it to Spring, highlighting what he gained in the process. Dec. 13, 2006

I18N Messages and Logging
By John Mazzitelli
Sick of internationalizing by making your own code take responsibility for finding and using ResourceBundles? The i18nlog project offers an annotations-based way to simplify your internationalization tasks and even allow you to internationalize your logging. John Mazzitelli explains why this is a good idea. Dec. 6, 2006

Java Generics and Collections: Evolution, Not Revolution, Part 2
By Maurice Naftalin, Philip Wadler
In the second part of an excerpt from Java Generics and Collections, authors Maurice Naftalin and Philip Wadler continue their study of how to adopt Java 5.0 generics in a measured, sustainable fashion. Having shown how to genericize a library while leaving the library in legacy mode, they now present three approaches to the opposite scenario: genericizing a client that uses a non-genericized library. Nov. 29, 2006

Java Generics and Collections: Evolution, Not Revolution, Part 1
By Maurice Naftalin
In this excerpt from Java Generics and Collections, authors Maurice Naftalin and Philip Wadler show how to make the switch to Java 5.0 generics, not by expecting you to flip a switch across your whole code base, but by having you gradually work generics into your code while maintaining compatibility. Nov. 22, 2006

Reshaping IT Project Delivery Through Extreme Prototyping
By Satya Komatineni
Why should the benefits of short iterations and a tight feedback loop be limited to the agile methodologies like Extreme Programming? In this article, Satya Komatineni explores the idea of Extreme Prototyping--the staged, ongoing development of a web app prototype that emerges into a final product. He shows how it can eliminate common design and project management errors. Nov. 15, 2006

Scaling Enterprise Java on 64-bit Multi-Core X86-Based Servers
By Dave Jaffe, Michael Juntao Yuan
Today's enterprise server--indeed, the environment--isn't what it was when Java was born. Slow networked machines have been replaced by fast, 64-bit multi-core servers that can house all your tiers in one box or even virtualize servers within the server. This has a significant effect on the design and deployment of your Java enterprise application, and Michael Yuan and Dave Jaffe show you how to get the most out of your hardware. Nov. 1, 2006

What is Java Content Repository
By Sunil Patil
You might have heard of JSR-170, but what is a content repository, and what can you do with it? Well, do you want to manage documents with versioning, search, access control, and more? Content repositories offer these features, and JSR-170 codifies them into a single API. Sunil Patil shows how to use the reference implementation--Apache Jackrabbit--to create a blogging application. Oct. 4, 2006

Tapestry: A Component-Centric Framework
By Hemangini Kappla
Tapestry offers an open source framework for rapid development of web applications using Java. It offers high performance, good code re-use, line-precise error reporting, and more. Hemangini Kappla offers an introduction to this widely used framework. Sep. 27, 2006

Don't Let Hibernate Steal Your Identity
By James Brundege
Hibernate has one set of ideas about how to make something unique, such as using a database sequence number as an ID. But this clashes with Java's need for implementations of equals() and hashCode() that determine identity for objects, even those that haven't yet made a trip to the database and thus can't have a sequence number. James Brundege has an option that should satisfy both Hibernate and Java. Sep. 13, 2006

Separation of Concerns in Web Service Implementations
By Tieu Luu
The principle of "separation of concerns" is much repeated in SOA circles... so why are transactional integrity, security, and business logic so often intermingled in SOA implementations? In this article, Tieu Luu shows how to use Spring to separate out security concerns in an Axis-based web service. Sep. 6, 2006

How to Publish Multiple Websites Using a Single Tomcat Web Application
By Satya Komatineni
While the idea of mapping several names onto one Apache instance with VirtualHost directives is well known, what do you do when you're serving web apps with Tomcat? Satya Komatineni has both the code and the configs that you'll need to make this work. Aug. 30, 2006

Eclipse RCP: A Platform for Building Platforms
By Wayne Beaton
Where do you start when building a Java desktop application? All Java gives you by default is public static void main (String[]); it's up to you from there. Eclipse's Rich Client Platform (RCP) offers a tested design, commonly-needed widgets, a standardized component model, pervasive extensibility, and more. Wayne Beaton has an introduction to get you up to speed with RCP-based development. Aug. 23, 2006

Profiling Your Applications with Eclipse Callisto
By John Ferguson Smart
Callisto, a bundle of optional plugins for Eclipse, now comes with a profiling tool called the Test & Performance Tools Platform (TPTP). TPTP includes testing, tracing, performance monitoring, profiling, and static-code analysis tools. John Ferguson Smart offers this guided tour of how to use TPTP to speed up your apps.  Aug. 16, 2006

Ant 1.7: Using Antlibs
By Kev Jackson
Most Java developers use Ant to do builds and are familiar with its core tasks. But Ant's tasks tend toward an undesirable coupling: everything important had to be a core task because it was hard to distribute new plug-in tasks. Fortunately, Ant 1.7's new antlibs feature makes it much easier to distribute and use new Ant tasks. In this article, Kev Jackson shows you how to use, write, bundle, and test antlibs. Aug. 9, 2006

JDBC 4.0 Enhancements in Java SE 6
By Srini Penchikala
Java SE 6 (aka Mustang) brings with it a new set of improvements to the JDBC API for accessing databases. Improvements include support for the RowID interface, better exception handling, annotation-based queries, and (finally!) and end to the clumsy Class.forName() system of loading database drivers. In this article, Srini Penchikala tours the major features of JDBC 4.0. Aug. 2, 2006

Deploying BIRT
By Jason Weathersby
If you have a need for generating or displaying reports, you may want to have a word with BIRT. The Business Intelligence and Reporting Tools project is an open source Eclipse effort to enable the creation and deployment of complex reports. Jason Weathersby shows you how to grind out reports and display them in web applications and RCP-based desktop apps. Jul. 26, 2006

What Is Geronimo?
By Kunal Jaggi
Geronimo is Apache's open source, Java EE-compatible application server, based on a flexible system of interchangeable components. This makes it ideal for a wide range of enterprise deployments. In this article, Kunal Jaggi shows you how to get started with Geronimo. Jul. 19, 2006

Outsourcing Java SE
By Daniel H. Steinberg
Many eyes are on Sun, awaiting the promised eventual open-sourcing of its Java SE implementation. But Daniel Steinberg has another idea: instead of open-sourcing Java, Sun should outsource it, so that it can be developed by parties more attuned to the needs and opportunities of cross-platform development. Jul. 12, 2006

What's New in Eclipse 3.2 Java Development Tools
By Ed Burnette
The popular Eclipse IDE's latest release, version 3.2, is the cornerstone of an ambitious release of ten Eclipse-branded projects on the same day. But what's in it for you? Ed Burnette takes a look at the new features in Eclipse's Java Development Tools and shows you how they'll make your development much easier. Jun. 28, 2006

Making the Most of JDBC with WebRowSet
By Sharad Acharya
Database to XML and back again. If everyone's doing some or all of this, then shouldn't we write it once, get it right, and standardize? JDBC 3.0's WebRowSet offers a profound increase in power over the old ResultSet. Sharad Acharya shows you what's possible. Jun. 21, 2006

What Is Jetty
By Q Ethan McCallum
Of course Tomcat is the first Java application server you think of, but is it the right tool for every job? The open source Jetty serves up JSPs and servlets in just a fraction of the memory needed by other app servers and is designed for easy embedding in other applications and non-traditional Java environments. Ethan McCallum takes a look at the big things in this small package. Jun. 14, 2006

Working with the Google Web Toolkit
By Robert Cooper
The Google Web Toolkit was the talk of JavaOne 2006, offering developers a way to create Ajax applications by writing Java and having the toolkit generate the client-side JavaScript, which can call back to Java servlets through an RPC-like call. Robert Cooper offers an initial tutorial to get you up and running with GWT. May. 31, 2006

Telling Stories at JavaOne
By Daniel H. Steinberg
JavaOne 2006 left attendees with an incomplete answer to the big question: will Sun open source Java? The answer was better than a definite maybe, but not by much. Daniel Steinberg looks back at the conference, its mixed message, and its many successes outside of the general sessions.  May. 24, 2006

Standardizing Java Persistence with the EJB3 Java Persistence API
By Debu Panda
Dissatisfaction with entity beans as an "official" means of persisting Java objects to databases has prompted a number of "unofficial" approaches, such as the very popular Hibernate. Now EJB3 seems to have learned its lesson: its new Java Persistence API allows you to persist plain old Java objects (POJOs) with a minimum of fuss and just a few annotations. Debu Panda looks at how to put this new standard to work. May. 17, 2006

Real-Time Java: An Introduction
By Peter Mikhalenko
"Real-Time" Java doesn't mean "really fast," but it does mean "really predictable," and that's especially important in many fields where an unpredictable response time, usually caused by the Java Virtual Machine's garbage collector, can cost money or lives. Peter Mikhalenko looks at the Real-Time Specification for Java and Sun's first implementation of the spec. May. 10, 2006

Configuration Management in Java EE Applications Using Subversion
By Swaminathan Radhakrishnan
Does your enterprise Java application need to store not only complex objects or documents but a history of changes to them? Many developers try to solve this problem with database wizardry, but it's probably a better option to hand the job over to a configuration management system that is built for the task. In this article, Swaminathan Radhakrishnan shows how you can implement requirements for change tracking by using a Subversion repository from your Java application, by way of the JavaSVN library. May. 3, 2006

The Mustang Meets the Rhino: Scripting in Java 6
By John Ferguson Smart
Among Java SE 6's key features is the ability to mix scripting languages into Java code, thanks to the implementation of the JSR-223 spec. In this article, John Ferguson Smart takes a look at the spec and what it means for Java, and shows how to use Java 6's integrated Rhino implementation to call JavaScript from Java...and vice versa. Apr. 26, 2006

Database Connection Pooling with Tomcat
By Kunal Jaggi
You know how to open and use database connections for each user, but what about optimizing for many concurrent users? Rather than creating and destroying connections over and over again, established practice calls for use of a pool of connections that can be reused. Kunal Jaggi shows how to implement this strategy in Tomcat. Apr. 19, 2006

Agile Object to Relational Database Replication with db4o
By Jim Paterson
Start with the idea of an object database, like db4o, which effortlessly persists arbitrary objects, even those with deep structures, into a database. Then mix in a little Hibernate. Now you can map objects to either the db4o database or a relational database. And as Jim Paterson shows, the db4o Replication System allows you to do some interesting things, even replicating between two relational databases, using db4o in the middle. Apr. 12, 2006

Implementing Mutual Exclusion for AJAX
By Bruce Wallace
AJAX programmers who come from the Java world can, or at least should, be concerned with JavaScript's non-support for safely managing data structures in a concurrent fashion. If one thread is changing the DOM while another is reading it, problems are likely. Java developers can attack this with tools from the synchronized keyword and the old Object wait()/release() to the modern java.util.concurrent package introduced in J2SE 5.0. Bruce Wallace addresses the problem by introducing protection for critical blocks of JavaScript code. Apr. 5, 2006

Zero Configuration Networking: Using the Java APIs, Part 3
By Stuart Cheshire, Daniel H. Steinberg
In this final excerpt from Zero Configuration Networking: The Definitive Guide, Stuart Cheshire and Daniel H. Steinberg take the Java bindings to Apple's Zeroconf implementation and apply them to creating a networked Swing tic-tac-toe game, in which each instance can discover and compete against other instances on the network. Mar. 29, 2006

Maven 2.0: Compile, Test, Run, Deploy, and More
By Chris Hardin
Maven is popular for bringing order, expertise, and experience to Java project creation and management. Maven 2.0 makes a sharp break with the 1.0 line, and forges a path independent of its roots in Ant. Chris Hardin's introduction shows what Maven 2 can do for you and how to make it work. Mar. 29, 2006

Advanced Configuration of the Spring MVC Framework
By Dejan Bosanac
Storing your Spring configuration files in source control makes perfect sense--until you and the rest of the development team start overwriting each other's settings, or production settings, in applicationContext.xml. In this article, Dejan Bosanac introduces an approach that allows for more flexible property settings and bean wirings. Mar. 22, 2006

Zero Configuration Networking: Using the Java APIs, Part 2
By Stuart Cheshire, Daniel H. Steinberg
In this second part of an excerpt from Zero Configuration Networking: The Definitive Guide, Stuart Cheshire and Daniel H. Steinberg show how Java clients can browse for and resolve Zeroconf services, and how to register and add, update, and delete services with DNS TXT attributes. Mar. 22, 2006

Zero Configuration Networking: Using the Java APIs, Part 1
By Stuart Cheshire, Daniel H. Steinberg
Zeroconf, also known as Bonjour and previously known as Rendezvous, offers a robust system for self-networking that has been adopted by many applications. With a provided Java API, now it's easy to make Zeroconf applications hop platforms. In this excerpt from Zero Configuration Networking: The Definitive Guide, Stuart Cheshire and Daniel H. Steinberg show how to register a service with Zeroconf. Mar. 15, 2006

JBoss Seam
By Thomas Heute
Many frameworks are perfectly sensible and well-designed on their own, but don't work particularly well when you try to combine them. Combining, for example, JSF and EJB 3.0 requires a lot of glue code, and adding another framework like JBoss BPM confuses things further. JBoss Seam is designed to provide common context for frameworks to share objects. Project leader Thomas Heute introduces Seam and what you can do with it. Mar. 15, 2006

What Is Java
By Chris Adamson
Everyone knows what Java is, right? Interpreted code, applets, proprietary, and slow. Wrong, wrong, wrong, and wrong. In its second decade, it's time to re-evaluate Java: the language and the virtual machine are going their own ways, its open source sub-community is vibrant and independent, and developers are taking the best ideas from other languages and frameworks and bringing them to Java. In this article, ONJava editor Chris Adamson tries to reset old assumptions about Java to fit modern realities. Mar. 8, 2006

Storing an XML Document in Apache Xindice
By Deepak Vohra
Apache Xindice is a database that's built specifically for storing XML data, meaning you can forget about attempting to map your XML-to-database tables and just store it as is, exploiting the structure nature of the XML data to pick up some query-time conveniences. Deepak Vohra introduces this database and shows how to make it work. Mar. 8, 2006