advertisement
javaboutique
Search Tips
Articles  |   Tutorials  |   Reviews  |   Tools  |   by Category  |   by Date  |   by Name  |   Submit  |   Source  |   Forums  |  
javaboutique
Browse DevX


Partners & Affiliates











advertisement

Tutorials : Coding your second Jakarta Struts Application :

Coding your second Jakarta Struts Application

by Keld H. Hansen

Introduction

Did the title of the article make you curious? If this is the second application then what was the first one? The answer is, the first application was presented in my previous article about Jakarta Struts, "Stepping through Jakarta Struts". Here I showed you:

  • how to download and install Struts
  • the directory structure of a Struts application
  • how to create the first pieces of a new application
  • the contents and purpose of the configuration files
  • how to build a simple Struts HTML page using taglibs
  • how to code an ActionForm class
  • how to code an Action class
  • and finally how to test your application

The "application" that I used as the example was a simple HTML page containing a form with the common controls--text and textarea fields, radio buttons, a checkbox, a selection list (drop down), and a submit button. The submit button would simply submit the form to the page again, and despite the simplicity of the application, all of the main pieces of the Struts framework were being used.

In this article I'll show you how to take one more step up the Struts ladder. This time we'll build a classic list-detail application with the well-known CRUD-actions: Create, Read, Update, and Delete.

The DVD library application

Reuse is a good thing, so I decided to take the specs for our second application from a previous article of mine, "Java and JDOM: the perfect couple". Here, a small web application that could manage a collection of DVDs was built. The DVD information is held in an XML file. The application consists of two pages, a DVD List page and a DVD Detail page. Here's the List page first:

 

When you click on one of "Id"-hyperlinks you'll go to the Detail page:

As you can see there are 7 functions in total to implement: list, detail, save, update, create, delete and cancel. The flow of the application is as follows:

In the JDOM article, I used a very simple MVC-architecture using only jsp-pages (even for the controllers) and JavaBeans. The beans can be re-used in the Struts application, and also the html layout. To finish the Struts application we'll have to:

  • write the proper configuration files (struts-config.xml and ApplicationRessources.properties)
  • code ActionForm and Action classes for the 7 functions
  • write the two jsp-pages using Struts tags
 

How to Add Java Applets to Your Site

New on the Java Boutique:

New Review:

Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling API boasts simplicity, ease-of-integration, a well-rounded feature set, and it's free!

New Applet:

Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA sequences into three useful formats.

Elsewhere on internet.com:

WebDeveloper Java
Lots of Java information on webdeveloper.com

WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.

ScriptSearch Java
Hundreds of free Java code files to download.

jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.

 Microsoft RIA Development Center
 IBM Rational Resource Center
 Destination .NET
XML error: not well-formed (invalid token) at line 33
advertisement
Receive Articles via our XML/RSS feed
Receive Articles via our XML/RSS feed

JavaBytes
Internet Cyclone
This powerful, easy-to-use, internet optimizer is for Windows 95, 98, ME, NT, 2000 and XP. It's designed to automatically optimize your Windows settings, boosting your Internet connection up to 200%.

JUNOS: Open, but Not Open Source
Sun Gives Enterprises a New Mobility Option
iPhone Knocking on the Enterprise
Linux 2.6.26 Opens Up to Debugging
Borland Launches ALM Management Tools
Nominations Open for CEO Vision Awards
A Look at Google's Open Source Protocol Buffer
MySpace Catches iPhone Fever
Software Drives the iPhone 3G
Novell's Linux Build Service Goes Open

Introduction to Scrum
Semantic Search Arrives at the Web
Using the New ListView Control in ASP.NET 3.5
SMS Messaging Using the .NET Compact Framework
Security Enhancements Abound in Windows Server 2008
Design and Use of Moveable and Resizable Graphics, Part 2
Control Your Linux Server Remotely with GnuPG, procmail, and PHP
The Baker's Dozen: 13 Tips for Building Database Web Applications Using ASP.NET 3.5, LINQ, and SQL Server 2005 Reporting Services
Probe and Modify Your Types' Alignment Programmatically
.NET Building Blocks: Custom User Controls in Practice

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About



JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers