Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Preface
Introduction
Requirements
New Project Setup & Structure
Starting a Struts Project
1. Components of a Struts Project
2. Building our Application
6. Running the Demo
7. Summary
8. User Feedback
1. Preface
This document was written using MyEclipse. All screenshots are based upon the default user interface settings for MyEclipse and Windows XP. If you experience difficulty
with the instruction of this document, please see the User Feedback section for how to provide feedback to the MyEclipse documentation team.
top
2. Introduction
In this tutorial we will be walking through the development and testing of a simple Struts example application using MyEclipse Enterprise Workbench. Previous knowledge
of Struts and/or MyEclipse is not necessary.
This tutorial, because of the framework's similarity and feature coverage, will be very similar to the JSF tutorial. We will follow the same project goals and outline so you
can later compare JSF with Struts, once you've gotten a better understanding of how to use the Struts tools in MyEclipse. Please note that although Struts 1.x is used in
the example, Struts 2.x is also supported by MyEclipse and can be substituted instead, if desired.
top
3. Requirements
Below is a list of software used by this guide:
MyEclipse (download available here).
Tomcat 5.0.x (download available here ). Please note that Tomcat 5 is already included within MyEclipse in the Integrated Server Sandbox so a separate installation
is optional, but not required.
For this demo the User Name is "myeclipse" and the Password is "myeclipse" as well.
www.myeclipseide.com/documentation/quickstarts/struts/
1/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
2/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
3/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
4/18
10/9/13
Note: The screenshot of the application flow was built using the Struts Designer. We will go into detail on how to access it and use it in the next section..
www.myeclipseide.com/documentation/quickstarts/struts/
5/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
6/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
7/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
8/18
10/9/13
Form, Action and JSP wizard to create the first JSP page along with the related Action and ActionForm.
Let's create the userLoginSuccess.jsp JSP page from our designer view by using the "JSP" palette tool by clicking it first then clicking our canvas. Follow Figure 12 below
for guidance:
www.myeclipseide.com/documentation/quickstarts/struts/
9/18
10/9/13
taglib
taglib
taglib
taglib
taglib
www.myeclipseide.com/documentation/quickstarts/struts/
10/18
10/9/13
<body>
Hello <bean:write name="userName" scope="request" />, you successfully logged in!
</body>
</html:html>
www.myeclipseide.com/documentation/quickstarts/struts/
11/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
12/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
13/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
14/18
10/9/13
15/18
10/9/13
Now that the application is complete, we can deploy it to Tomcat 5 by opening the Manage Deployments Dialog and setting up a new deployment for this project. You can
open the management dialog, shown in Figure 25, by either right clicking on your project in the Package Explorer view and selecting MyEclipse > Add and Remove
Project Deployments, or by clicking the Deploy J2EE Project to Server button in the toolbar:
Note: It is assumed that you have already setup the Tomcat 5 (or other) application server connector in MyEclipse. If you have not and need help doing that, please see
the Application Server Tutorial.
www.myeclipseide.com/documentation/quickstarts/struts/
16/18
10/9/13
www.myeclipseide.com/documentation/quickstarts/struts/
17/18
10/9/13
7. Summary
In this demo we developed a simple Struts application using the Struts tools available in MyEclipse Enterprise Workbench.
This concludes your introduction to Struts. Additional Tutorial documents are available that introduce working with Web Projects, editing, application server
configuration, enterprise application projects and database development. For more information visit the MyEclipse Tutorial library.
top
8. User Feedback
If you have comments or suggestions regarding this document please submit them to the MyEclipse Documentation Forum.
top
www.myeclipseide.com/documentation/quickstarts/struts/
18/18