SlideShare a Scribd company logo
Server-side  Web Programming Lecture 11:  Modular Web Programming
Including Static Resources Pages on same site should have  same layout Site identifiable to user User knows where to look for major components (navbar, etc.) Example: CSS  style sheets to unify appearance  Example: All pages on site have same  navigation bar
Including Static Resources Bad idea:  copy and paste  html for navigation bar into each file If change layout, must modify  every file  on the site Better idea: “include”  single file  containing navigation bar into  every page  on site Just need to modify  single file Done client side with  frames navbar.htm JSPs included in
Server-side Includes Can use  web container  to include files Server page being generated for response Just include files Syntax: <%@ include file=&quot; relative file location &quot; %> For example:   <%@ include file=“navbar.html&quot; %>
Including Dynamic Resources Can break  dynamically generated  JSP into separate files Easier to develop and maintain as  group Configuration.jsp Information.jsp CreditCard.jsp
Including Dynamic Resources Syntax: <jsp:include page=&quot; relative file location &quot; />
Sample Included Page
Including Dynamic Resources Why different syntax? Steps in creating response: JSP translated into an equivalent servlet. Servlet is compiled. The doGet or doPost method of servlet run to create response page <%@ include file=“ … &quot; %>  executed  once  when compiled More efficient <jsp:include page=“ … &quot; />  must be executed  every  time page called Will generate  different  html each time based on user parameters <%@ include file=””%> <jsp:include page=“” />

More Related Content

PPTX
Responsive Web Development
PDF
Best Practices for Building Sites in dotCMS
PPT
Performance anti patterns in ajax applications
PPT
TSSJS2010 Presenatation on: Performance Anti Patterns In Ajax Applications
ODP
Compress
PPTX
ASP.NET Lecture 3
PPTX
Introduction to web application development
PPTX
Web Design Basics and HTML
Responsive Web Development
Best Practices for Building Sites in dotCMS
Performance anti patterns in ajax applications
TSSJS2010 Presenatation on: Performance Anti Patterns In Ajax Applications
Compress
ASP.NET Lecture 3
Introduction to web application development
Web Design Basics and HTML

What's hot (20)

PDF
Using html5 to build offline applications
PPTX
Super quick introduction to html5
PPTX
Introduction to web development
PPTX
Master pages ppt
PPTX
Master Pages In Asp.net
PPTX
PPTX
Master page in Asp.net
PDF
MVC Web Application
PPTX
Neos CMS and SEO
PPT
Html intro
PDF
Google Polymer Framework
PPTX
Improving web site performance and scalability while saving
PPTX
Web profiler in drupal 8
PDF
Web app architecture
PPTX
Html5 & less css
ODP
iPhone Web Development and Ruby On Rails
PPS
Asp.Net 2.0 Presentation
PPT
P&M302 Real-life building public-facing websites with SharePoint 2013
Using html5 to build offline applications
Super quick introduction to html5
Introduction to web development
Master pages ppt
Master Pages In Asp.net
Master page in Asp.net
MVC Web Application
Neos CMS and SEO
Html intro
Google Polymer Framework
Improving web site performance and scalability while saving
Web profiler in drupal 8
Web app architecture
Html5 & less css
iPhone Web Development and Ruby On Rails
Asp.Net 2.0 Presentation
P&M302 Real-life building public-facing websites with SharePoint 2013
Ad

Viewers also liked (19)

PPT
PPT
Lecture7 pattern
PPT
PPT
PPT
PPT
PPT
PPT
7 data management design
PPT
3 analysis and design overview
PPT
2 thu thap va mo hinh yeu cau
PPT
4b use-case analysis
Lecture7 pattern
7 data management design
3 analysis and design overview
2 thu thap va mo hinh yeu cau
4b use-case analysis
Ad

Similar to Lecture11 (20)

PPSX
04 asp.net session05
PPT
ASP.NET 06 - Customizing Your Sites Appearance
PDF
vitepress-en.pdf
PPT
Master pages
PPS
04 asp.net session05
PPT
Master pages
PDF
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
PDF
Csajsp Chapter12
PPS
04 asp.net session05
PDF
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
PDF
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
PPT
3.jsp tutorial
PDF
Grav CMS for Educators
PPTX
thinking in react slides for students.pptx
PPTX
PPT
Websites Unlimited - Pay Monthly Websites
PPTX
Ror caching
04 asp.net session05
ASP.NET 06 - Customizing Your Sites Appearance
vitepress-en.pdf
Master pages
04 asp.net session05
Master pages
DYNAMIC CONTENT TECHNOLOGIES ASP(ACTIVE SERVER PAGES)
Csajsp Chapter12
04 asp.net session05
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
JavaServer Pages Pocket Reference 1st Edition Hans Bergsten
3.jsp tutorial
Grav CMS for Educators
thinking in react slides for students.pptx
Websites Unlimited - Pay Monthly Websites
Ror caching

More from Châu Thanh Chương (14)

PPT
PPT
PPT
PPT
PPT
PPT
6 class design
PPT
5 transition to design
PPT
4a domain model
PPT
2b writing good use cases
PPT
1 gioi thieu httt
6 class design
5 transition to design
4a domain model
2b writing good use cases
1 gioi thieu httt

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PPTX
Machine Learning_overview_presentation.pptx
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Tartificialntelligence_presentation.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
cuic standard and advanced reporting.pdf
Machine Learning_overview_presentation.pptx
SOPHOS-XG Firewall Administrator PPT.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Advanced methodologies resolving dimensionality complications for autism neur...
A comparative analysis of optical character recognition models for extracting...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Machine learning based COVID-19 study performance prediction
Network Security Unit 5.pdf for BCA BBA.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation_ Review paper, used for researhc scholars
Spectroscopy.pptx food analysis technology
Tartificialntelligence_presentation.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Assigned Numbers - 2025 - Bluetooth® Document
gpt5_lecture_notes_comprehensive_20250812015547.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...

Lecture11

  • 1. Server-side Web Programming Lecture 11: Modular Web Programming
  • 2. Including Static Resources Pages on same site should have same layout Site identifiable to user User knows where to look for major components (navbar, etc.) Example: CSS style sheets to unify appearance Example: All pages on site have same navigation bar
  • 3. Including Static Resources Bad idea: copy and paste html for navigation bar into each file If change layout, must modify every file on the site Better idea: “include” single file containing navigation bar into every page on site Just need to modify single file Done client side with frames navbar.htm JSPs included in
  • 4. Server-side Includes Can use web container to include files Server page being generated for response Just include files Syntax: <%@ include file=&quot; relative file location &quot; %> For example: <%@ include file=“navbar.html&quot; %>
  • 5. Including Dynamic Resources Can break dynamically generated JSP into separate files Easier to develop and maintain as group Configuration.jsp Information.jsp CreditCard.jsp
  • 6. Including Dynamic Resources Syntax: <jsp:include page=&quot; relative file location &quot; />
  • 8. Including Dynamic Resources Why different syntax? Steps in creating response: JSP translated into an equivalent servlet. Servlet is compiled. The doGet or doPost method of servlet run to create response page <%@ include file=“ … &quot; %> executed once when compiled More efficient <jsp:include page=“ … &quot; /> must be executed every time page called Will generate different html each time based on user parameters <%@ include file=””%> <jsp:include page=“” />