Jakarta Struts + JdevelopesR

Páginas: 14 (3282 palabras) Publicado: 6 de noviembre de 2012
Using Jakarta Struts with Oracle9i JDeveloper


Introduction

Welcome to the Hands On Lab exercises for using Jakarta Struts with Oracle9i JDeveloper. These hands on exercises will familiarize you with how to use Struts in JDeveloper. The Struts exercises contain both simple exercises as well as more advanced exercises which integrate both Struts and BC4J.

This Hands On exercise requiresthe usage of Oracle9i JDeveloper version 9.0.3 and access to a database.

What is Struts?

Jakarta Struts is an open source project supported by the Apache software foundation. Struts
provides a framework using standard J2EE components such as JSPs, servlets, and JavaBeans for
building Model 2-a variant of Model View Control application design paradigm-applications.
Struts was written tosolve problems encountered by many enterprise application development
projects in that it provides solutions to common problems encountered when developing enterprise
Web applications such as page flow, internationalization, maintainability, and deployment flexibility.
Struts is now fully integrated into Oracle9i JDeveloper allowing developers to take advantage of all of it's strengths fromwithin a powerful Java Integrated Development Environment. (IDE).
The hands-on exercises are contained in the following Labs:

Lab 1 Building a Simple Struts Application

Exercise 1: Getting Started: Struts enabling your project
Exercise 2: Building your View Components
Exercise 3: Building Struts Form Beans and Actions
Exercise 4: Wiring it all together


Lab 2 Using Struts and BC4JExercise 1: Building a simple BC4J Project
Exercise 2: Building a simple BC4J Struts page
Exercise 3: Generating a BC4J Struts JSP application



Lab 1 Building a Simple Struts Application

In this Lab exercise we will be building a simple, easy to understand Struts application. This application consists of a simple login page along with some accompanying Struts based validation logic. Hereis a diagram of the Application we will build:
[pic]
Figure1: A Simple Struts Application
Notice that the App contains 3 JSPs, a login page, and a success and failure page. As the user submits the login form, he/she will then be directed to either the success page or failure page depending on whether the information supplied in the login form passed validation.

Exercise 1: Getting Started:Struts Enabling Your Project

In order to start using Struts in an application in JDeveloper, you must run the "Struts Starter Application" wizard to Struts enable your project.

Getting Started 

1. In JDeveloper, create a new Workspace or use an existing one. (The name of Workspace is not important.)
2. In your Workspace create a new project called SimpleStruts.jpr
File |New... | General | Empty Project
3. Name the directory, "SimpleStruts" and the project file, " SimpleStruts.jpr".
4. Once the project has been created, run the Struts Starter Application Wizard.
Select File | New
Choose Web-Tier in the Categories, and select Struts
Select Starter Application from the Items list
Click OK.
[pic]

5. Click Yes to run the Struts starterwizard.
6. The wizard will now Struts enable your project by doing the following:
o Adds the Struts runtime libraries to your project's properties.
o Adds (or Modifies) your web.xml file to use the Struts Controller (ActionServlet) servlet. It also defines a *.do servlet mapping.
o Adds a struts-config.xml file to your project. This is the overall configuration filefor a Struts application.
o Adds an ApplicationResources.properties file to your project. This file contains message strings for the overall application.
7. Save the project using File | Save All.

Exercise 2: Building Your View Components

We will now create the View Components login.jsp, success.jsp and failure.jsp. The JSP page login.jsp will contain an html form which is...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Jakarta struts
  • Struts
  • jakarta
  • Struts
  • Struts
  • Struts
  • Struts
  • Struts 2

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS