SlideShare a Scribd company logo
Extending Struts Prepared by: Ramez Hassan
Agenda Struts Overview : Basic review on struts framework. Stating struts main objects. What is a plug-in? ModuleConfig story. Tiles plug-in: Default design procedure. Tiles with struts.
Struts Overview Struts is a framework that is built on MVC 2 architectural pattern. Struts Flow review. Struts gives extension capabilities to each step.
Struts Overview Struts Main Objects: ActionServlet. RequestProcessor. ModuleConfig. ActionClass. ActionForm. JSP view.
What is a plug-in ? A plug-in is a configuration wrapper for a module-specific resource or service that needs to be notified about application startup and shutdown events.
What is a plug-in ? How to plug in a struts plug-in ?
What is a plug-in ? How to write a plug-in ?
What is a plug-in ? What is ModuleConfig ?
So, A Plug-in is … A useful feature in struts framework that facilitate:  Dynamically wrap any resource of struts framework, e.g. RequestProcessor. Initialize any business component for the application, e.g. Hibernate.
Tiles Plug-in Applying html layout procedures: Default Design procedure was to copy and paste layout to every new page. Altering in design could lead to a resources leak, even though it’s a periodical procedure for any web application.
Tiles Plug-in Applying html layout procedures (cont.): <jsp:include>  allows you to include either a static or dynamic file in a JSP file {every page will use jsp:include}. The problem: when the architecture changes even a small td in a table will lead to alterations in every page in the site.
Tiles Plug-in Tiles Solution : Applying same mechanism of  <jsp:include />   but with defining the layout it self in a separate page. The components in this case will be:
Tiles Plug-in Tiles Solution (cont.): Each new page in this case will require defining the following : Page body  (which the part that changes frequently, 0 to n pages). Page layout  (The layout that will be attached when displaying the page). Any dynamic or static content will be referenced in the layout, e.g.  header ,  footer  and/or  menu. This solution made it much better in changing layout but a little bit difficult in pages maintenance.
Tiles Plug-in Struts Tiles plug-in Solution: The same as tile solution except adding XML capabilities in definition and Objects relation as well.
Tiles Plug-in Struts Tiles plug-in Solution (cont.): Struts Tiles demo.
Tiles Plug-in Struts Tiles demo (cont.): XML Configurations:-
Tiles Plug-in Struts Tiles demo (cont.): Static Objects tiles_static/header.jsp tiles_static/menu.jsp tiles_static/footer.jsp
Tiles Plug-in Struts Tiles demo (cont.): Layout Definition Page: tiles_layout/layout_small.jsp
Tiles Plug-in Struts Tiles demo (cont.): Adding tiles into layout using struts-tiles.tld:
Tiles Plug-in Struts Tiles demo (cont.): Finally the page to display :- I can write my code in the page  /demos/myPage.jsp  and don’t worry about layout any more.
Tiles Plug-in Struts Tiles demo (cont.): How can struts actions interact with tile page:
Tiles Plug-in Configurations needed :
Tiles Plug-in How does tiles plug-in work…? Replaces RequestProcessor in  startup  with TilesRequestProcessor. TilesRequestProcessor class overrides  processForwardConfig()  to handle any navigation to any tiles definition. In processing a definition, all pages is included using  doForward()   doInclude()  or of RequestProcessor which uses methods of RequestDispatcher.
Tiles Plug-in Tiles attributes: TileScope is a ComponentContext for tiles components (pages). <tile:useAttribute name=“” id=“” scope=“”/> is used to move attributes from tiles scope to request scope.
Tiles Plug-in Tiles attributes (cont.): < put:list  name=“demoList”> < item  value=“link1&quot; link=&quot;/li1.do&quot; /> < item  value=“link2&quot; link=&quot;/li2.do&quot; /> < item  value=“link2&quot; link=&quot;/li3.do&quot; /> </ put:list > Values can be retrieved and used as  List  in any scope.
Questions ?
Thank You

More Related Content

PDF
Understanding solid principles
PPT
Developing great applications using ASP.NET MVC and ASP.NET AJAX
PDF
ngSummit 2017: Angular meets Redux
PPTX
Necto 16 training 20 component mode &amp; java script
PDF
The angular way 19 october 2013 Gdańsk
PPTX
React-JS Component Life-cycle Methods
PPTX
Knockout js
PPTX
บท7
Understanding solid principles
Developing great applications using ASP.NET MVC and ASP.NET AJAX
ngSummit 2017: Angular meets Redux
Necto 16 training 20 component mode &amp; java script
The angular way 19 october 2013 Gdańsk
React-JS Component Life-cycle Methods
Knockout js
บท7

Similar to Extending Struts(1) (20)

PDF
Step by Step Guide for building a simple Struts Application
PPT
Developing a Struts & Tiles application using WebSphere Studio
PDF
Step By Step Guide For Buidling Simple Struts App Speakernoted
PPTX
J2EE PPT --CINTHIYA.M Krishnammal college for women
PPT
Apachecon 2002 Struts
DOCX
Struts ppt 1
PDF
Struts An Open-source Architecture for Web Applications
PPT
MVC
PPT
Krazykoder struts2 plugins
PPT
Ibm
PPT
Struts Ppt 1
PPT
Struts,Jsp,Servlet
PPT
Strutsjspservlet
PPT
Strutsjspservlet
PDF
Struts Basics
PPT
Struts N E W
PDF
Jsf Framework
PPT
Project Description Of Incident Management System Developed by PRS (CRIS) , N...
PDF
Organinzing Your PHP Projects (2010 Memphis PHP)
Step by Step Guide for building a simple Struts Application
Developing a Struts & Tiles application using WebSphere Studio
Step By Step Guide For Buidling Simple Struts App Speakernoted
J2EE PPT --CINTHIYA.M Krishnammal college for women
Apachecon 2002 Struts
Struts ppt 1
Struts An Open-source Architecture for Web Applications
MVC
Krazykoder struts2 plugins
Ibm
Struts Ppt 1
Struts,Jsp,Servlet
Strutsjspservlet
Strutsjspservlet
Struts Basics
Struts N E W
Jsf Framework
Project Description Of Incident Management System Developed by PRS (CRIS) , N...
Organinzing Your PHP Projects (2010 Memphis PHP)
Ad

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Machine learning based COVID-19 study performance prediction
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
Teaching material agriculture food technology
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
KodekX | Application Modernization Development
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
cuic standard and advanced reporting.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Encapsulation_ Review paper, used for researhc scholars
Machine learning based COVID-19 study performance prediction
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
20250228 LYD VKU AI Blended-Learning.pptx
Spectral efficient network and resource selection model in 5G networks
Network Security Unit 5.pdf for BCA BBA.
Reach Out and Touch Someone: Haptics and Empathic Computing
Review of recent advances in non-invasive hemoglobin estimation
Teaching material agriculture food technology
Mobile App Security Testing_ A Comprehensive Guide.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Unlocking AI with Model Context Protocol (MCP)
Empathic Computing: Creating Shared Understanding
Understanding_Digital_Forensics_Presentation.pptx
MIND Revenue Release Quarter 2 2025 Press Release
KodekX | Application Modernization Development
NewMind AI Weekly Chronicles - August'25 Week I
cuic standard and advanced reporting.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Ad

Extending Struts(1)

  • 1. Extending Struts Prepared by: Ramez Hassan
  • 2. Agenda Struts Overview : Basic review on struts framework. Stating struts main objects. What is a plug-in? ModuleConfig story. Tiles plug-in: Default design procedure. Tiles with struts.
  • 3. Struts Overview Struts is a framework that is built on MVC 2 architectural pattern. Struts Flow review. Struts gives extension capabilities to each step.
  • 4. Struts Overview Struts Main Objects: ActionServlet. RequestProcessor. ModuleConfig. ActionClass. ActionForm. JSP view.
  • 5. What is a plug-in ? A plug-in is a configuration wrapper for a module-specific resource or service that needs to be notified about application startup and shutdown events.
  • 6. What is a plug-in ? How to plug in a struts plug-in ?
  • 7. What is a plug-in ? How to write a plug-in ?
  • 8. What is a plug-in ? What is ModuleConfig ?
  • 9. So, A Plug-in is … A useful feature in struts framework that facilitate: Dynamically wrap any resource of struts framework, e.g. RequestProcessor. Initialize any business component for the application, e.g. Hibernate.
  • 10. Tiles Plug-in Applying html layout procedures: Default Design procedure was to copy and paste layout to every new page. Altering in design could lead to a resources leak, even though it’s a periodical procedure for any web application.
  • 11. Tiles Plug-in Applying html layout procedures (cont.): <jsp:include> allows you to include either a static or dynamic file in a JSP file {every page will use jsp:include}. The problem: when the architecture changes even a small td in a table will lead to alterations in every page in the site.
  • 12. Tiles Plug-in Tiles Solution : Applying same mechanism of <jsp:include /> but with defining the layout it self in a separate page. The components in this case will be:
  • 13. Tiles Plug-in Tiles Solution (cont.): Each new page in this case will require defining the following : Page body (which the part that changes frequently, 0 to n pages). Page layout (The layout that will be attached when displaying the page). Any dynamic or static content will be referenced in the layout, e.g. header , footer and/or menu. This solution made it much better in changing layout but a little bit difficult in pages maintenance.
  • 14. Tiles Plug-in Struts Tiles plug-in Solution: The same as tile solution except adding XML capabilities in definition and Objects relation as well.
  • 15. Tiles Plug-in Struts Tiles plug-in Solution (cont.): Struts Tiles demo.
  • 16. Tiles Plug-in Struts Tiles demo (cont.): XML Configurations:-
  • 17. Tiles Plug-in Struts Tiles demo (cont.): Static Objects tiles_static/header.jsp tiles_static/menu.jsp tiles_static/footer.jsp
  • 18. Tiles Plug-in Struts Tiles demo (cont.): Layout Definition Page: tiles_layout/layout_small.jsp
  • 19. Tiles Plug-in Struts Tiles demo (cont.): Adding tiles into layout using struts-tiles.tld:
  • 20. Tiles Plug-in Struts Tiles demo (cont.): Finally the page to display :- I can write my code in the page /demos/myPage.jsp and don’t worry about layout any more.
  • 21. Tiles Plug-in Struts Tiles demo (cont.): How can struts actions interact with tile page:
  • 23. Tiles Plug-in How does tiles plug-in work…? Replaces RequestProcessor in startup with TilesRequestProcessor. TilesRequestProcessor class overrides processForwardConfig() to handle any navigation to any tiles definition. In processing a definition, all pages is included using doForward() doInclude() or of RequestProcessor which uses methods of RequestDispatcher.
  • 24. Tiles Plug-in Tiles attributes: TileScope is a ComponentContext for tiles components (pages). <tile:useAttribute name=“” id=“” scope=“”/> is used to move attributes from tiles scope to request scope.
  • 25. Tiles Plug-in Tiles attributes (cont.): < put:list name=“demoList”> < item value=“link1&quot; link=&quot;/li1.do&quot; /> < item value=“link2&quot; link=&quot;/li2.do&quot; /> < item value=“link2&quot; link=&quot;/li3.do&quot; /> </ put:list > Values can be retrieved and used as List in any scope.