Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home4/vir007/public_html/geekmantra.com/contact/connect.php on line 2
Free Online Struts Architecture Tutorials in Struts,Struts Architecture in Struts
GeekMantra
Search Site

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home4/vir007/public_html/geekmantra.com/contact/connect.php on line 2
J2SE [Java 2 Standard Edition]
Core Java Introduction
Exception Handling
Collection & Util Classes
Multithreading
Input & Output Streams
Applet
Adwance Windows Toolkit (AWT)
Swings (Adwance GUI)
Event Handling
Java Networking
Remote Method Invocation (RMI)
Java Database Connectivity (JDBC)
J2EE [Java 2 Enterprise Edition]
Java 2 Enterprise Edition Intoduction (J2EE)
Server Side Programming (Servlet)
Java Server Pages (JSP)
Enterprise Java Bean
MVC Framework (Struts)
Advance Framework (Springs)
Object-relational mapping (Hibernate)
eXtensible Markup Language (XML)
Asynchronous JavaScript and XML (AJAX)
Miscellneous
Monthly News Letter
Free SCJP Samples
Interviews Questions For Freshers
Interviews Questions For Experinced
Most Visited Links
Most Freaky Links
Advertisements

Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home4/vir007/public_html/geekmantra.com/contact/connect.php on line 2

Struts Framework

What a framework means?
• an extensible/generic/flexible architecture following set of standards and patterns
• Focuses on a specific domain (web / j2ee applications etc)
• Provides extension points
• Can be customized and used on projects
What is Struts Framework?
• Provide APIs those are used to create web applications
• Uses Java Beans, Java Servlets, and Java Server pages (JSP)
• Based on the MVC design pattern
• Rich set of tag libraries provided for presentation tier
• Extensible

Struts Framework

Struts API Zoo

Sturts API

• Most of the times we will extend ActionForm for making input page form beans and Action class for
putting the business logic like we did in servlet.
• We can customize controller parts also.
• Most of the API and tags works in internationalized fashion, so they will take data to display as a key
and we will define these key-values into properties file. So by default our application will be
multilingual.
• We can define our validation rules on user inputs into xml, means highly configurable and reusable
validation code.
• We can break our look and feel into tiles and each tile can be configured through xml, means making the
presentation configurable.
• We define the flow inside the struts-config.xml that makes our application flow highly configurable.
So waiting for what this is the right time to write HelloWorld…..

HelloWorld Setup

hello world

hello world

hello world

For accessing the application type following URL in your browser
http://localhost:8080/hello/welcome.do

1. Since the request ends at .do so the ActionServlet will get called. This servlet works as Front
Controller.

2. ActionServlet will take out /welcome from /welcome.do and look for mapping
3. it will found direct forward rule and will forward the request to /hello.jsp
4. when you submit the hello.jsp page in action it calls /hello.do
5. again step 1 and 2 will be repeated
6. Now this time it founds an action class and form associated with this action.
7. instantiate the form bean object, called the setter method for properties name matched and then called
the validate method which returns ActionErrors object
8. it check this object if empty then execution goes to HelloAction execute() method else it forward the
request to input="/hello.jsp"
9. in execute we cast the form, fetch the value and then added into request
request.setAttribute("message", "Your Message " + msg + " received!!!");
execute() returns ActionForward that hold the logical name of the page to be forwarded.
<forward name="success" path="/success.jsp"></forward>
And finally we see the success.jsp as a final output.

hello world