Tuesday, March 31, 2009

Developing Simple Program in STRUTS

Developing Simple Program in STRUTS 1.3.10
In this article, I will show you how to develop simple program called “MiniHR” by using Struts 1.3.10.

Requirements:
1. Java SDK 1.6
2. Struts 1.3.10 (
http://struts.apache.org/download.cgi ). Download the Full Distribution.
3. Apache Ant 1.7.1 (http://ant.apache.org/bindownload.cgi ). Download the .zip archive.
4. Apache Tomcat 5.5.17(
http://software.emule.com/apache-tomcat-5-5-17/ )


Installation Guide:
1. Install Java SDK 1.6 . In my case, I install in “C:\Program Files\Java”

2. Create a new record under System Variables in your Environment Variable.
    Variable: JAVA_HOME
    Value: C:\Program Files\java

3. Extract the Struts 1.3.10 into your harddisk. In my case, I copy to my “C:/Program Files” folder.
4. Extract Apache Ant 1.7.1 into your harddisk. In my case, I copy to my “C:/Program Files” folder.
5. Create a new record under System Variables in your Environment Variable.
    Variable: ANT_HOME
    Value: C:\Program Files\apache-ant-1.7.1


Below are files that needed to built our MiniHR program:

File

Description

index.jsp

Contains the JSP that is used as a gateway page for the Mini HR application and provides a link to the Employee Search Page

search.jsp

Contains the JSP that is used for performing employee searches and displaying the search result

SearchForm.java

Contains the class that captures and transfer data to and from the Search Page.

SearchAction.java

Contains the class code that processes requests from the Search page.

EmployeeSearchService.java

Contains the class that encapsulates the business logic and data access involved in searching for employees.

Employee.java

Contains the class that represents an employee and encapsulates all of an employee’s data.

web.xml

Contains the XML that is used to configure the servlet container properties for the Mini HR Java Web Application

struts-config.xml

Contains the XML that is used to configure the Struts framework for this application

MessageResources.properties

Contains properties that are used to externalize application strings, labels, and messages so that they can be changed without having to recompile the application.


No comments:

Post a Comment

Followers