Struts for Beginners
These tutorial teaches you basic concepts of Struts to get you started with Struts.
Struts is a mature open source MVC(Model-View-Controller) frame work for
web applications. Struts we can be easily integrated with various technologies
like J2EE , Hibernate, iBATIS, JSTL and JSF, Velocity Templates, XSLT etc.
- Introduction: Struts is a very popular framework
and has now become a de-facto standard for Java applications.
- MVC Design Pattern: Model View Controller approach
was developed by small talk developers and was widely embraced by the
developer community. Various Java technologies like Swing, J2EE, Struts
draw a lot of features from MVC design pattern.
- Installation: Prerequisites and Installations
- Action Servlets: Lets investigate
the deployment descriptor WEB-INF/web.xml for struts.
- Hello World: Write your first Struts
- Forms & ActionForms: Lets now explore
the forms. Forms are the HTML elements where the user enters some values
and submits the form and gets the results page. We will now create a
login page to see how it works in struts.
- Messages Resources: Struts framework provides
property files functionality with internationalization (I18N) features.
These message resources can be configured in Struts configuration file.
- Data Bases: Lets convert our dumb
login program to an intelligent login program which connects to the
data base and validates the user name and password before spitting out
- Exceptions: Like all other configurable
features in Struts, Exceptions can be also handled using configurations.
This configuration methodology is usually called declarative exception
- Accessing Action Forms from JSP Pages : Action
Forms can be accessed from the JSPs using tags-bean
tag library. This section describes the procedure to display values
of the bean LoginForm.java in the JSP page.
- Logic Tag: Lets modify our login
program to learn about logic tag library. We will modify this proram
to list all the users in the database.