SlideShare a Scribd company logo
1 of 19
GOVERNMENT ARTS COLLEGE
Melur, Madurai
By
Mr. V. Veeranan
Roll No: P22PCS123
I M.Sc. Computer Science
Topic: Server Side Include
(Cookies and Filters)
PG. Department of Computer Science
ADVANCED JAVA PROGRAMMING
Server Side Includes (SSI)
Embed instructions to the Server
Inside an HTML document
HTML tag Language
A special file -> .shtml
SHTML -> the web server
Servlets
To add small of dynamic content
Otherwise static HTML pages
Server-side Includes(SSI)
 Server-Side Includes (SSI) give you the ability to embed
instructions to the server inside an HTML document.
 The instructions are given using extensions to the HTML tag
language. A special file extension,
 . shtml, signals the server that the document contains SSI directives.
 SHTML is a file extension that lets the web server know the file
should be processed as using Server Side Includes(SSI)
 Servlets are not confined to handling entire requests. Some web
servers allow servlets to add small amounts of dynamic content to
otherwise static HTML pages.
Server Side Include Tag
 A page that uses the advertisement servlet is written just like a normal
HTML page, except that it contains one or more <SERVILET> tags
and is saved with the .shtml extension.
• The <SERVIET> tag is similar to the <APPLET> tag, which loads an
applet within a page. When a client requests a .shtml page, the server
finds all of the <SERVLET> tags in the text and replaces them with the
output from the appropriate servlets.
• When you use a <SERVLET> tag, you must include a CODE parameter
that identifies the servlet to be loaded. This can be a class name or a
servlet allas set up within the server. On some servers, you can specify
an optional CODEBASE parameter that loads the servlet code from a
remote location.
Server Side Include
• Any additional parameters are treated as servlet initialization
parameters. Each <SERVLET> tag must be matched by a
closing</SERVLET> tag.
• Between the opening and closing tags, you can include as many
<PARAM> tags as necessary, where you specify NAME and
VALUE attributes for each one.
• The servlet can them access these parameters with getParameter().
Example (Time.shtml)
<HTML>
<HEAD> <TITLE> Times1</TITLE></HEAD>
<BODY>
The current time here is:
<SERVLET CODE=CurrentTime>
</SERVLET>
<p>
The current time in London is:
<SERVLET CODE
Cookies
• Cookies is a small text file containing client information sent by a
web server to a browser that can later be read back from the
browser.
• When a browser receives a cookie, it saves the cookie and there after
sends the cookie back to the server each time it accesses a page on
the server, subject to certain rules.
• Since cookie’s value can uniquely identify a client, cookies are often
used for session tracking.
• The browser is expected to support 20 cookies for each Web server,
300 cookies total any may limit cookie size to 4kb each.
Cookies
Working with Cookies
Cookies Methods
Working with Cookies
Create Cookie Class Constructor
public Cookie(String name, String Value())
Create Cookie, Send -> Browser
HttpServletResponce.addCookie(Cookie Cokie)
Servlet -> Request
HttpServletRequest.getCookies()
Cookie Methods
Specifies a Comment
public void setComment(java.lang.String purpose)
Comment using describing
public java.lang.String getComment()
Specifies the Domain name
public void setDomain(java.lang.String pattern)
The Maximum age -> Cookie
public void setMaxAge(int expiry)
Positive Vallue -> Negative value -> Zero Value
Return the Maximum age -> Cookie
public int setMaxAge()
Set of URIs -> Client
public void setPath(java.lang.String.url)
Cookie Methods
Returns the Paths
public java.lang.String.getPath()
Indicates to the Browser
public vaid setSecure(boolean flag)
Returns true if -> Browser -> Sending
public Boollean getSecure()
Filters
 Filter is a component which dynamically intercepts requests
and responses to transform or use the information contained
in the requests or response,
 Filters typically do not themselves create responses but
provide universal functions that can be “attached” to any
type of servlet or JSP page.
 A filter is a program that runs on the server before the servlet
with which it is associated.
Benefits of Filters
 Filters encapsulates common behaviour in a modular and
reusable manner.
 It separates high-level access decisions from presentation
code.
 It applies wholesale changes to many different resources.
Types/Components of Filters
Filters can perform many different types of functions. Based on
their functionalities following are the filters
 Authentication: Blocking requests based on user identity.
 Logging and auditing: Tracking users of a web application.
 Image conversion: Scaling maps and so on.
 Localization: Targeting the request and response to particular
locale.
 XSL/T Transformations of XML Content: Targeting web
application responses to more than one type of client.
Programming a Filter
 Create a class that implement the filter interface
 Put the filtering behaviour in the doFilter method
 Call the doFilter Method of the FilterChain object
 Register the filter with the appropriate servlets and JSP pages
 Disable the invoker servlet.
Filter Element in web.xml
 Icon
 Filter-name
 Display-name
 Description
 Filter-class
 Init-param
 Filter-Mapping Element
 Filter-name
 url-pattern
 Servlet-name
Process of Registering
Filter with Servlet
 One filter can be associated with more than one servlet.
 More than one filter can be mapped to a servlet.
 A filter can be mapped to all the servlet using an “*”.
 The filter, filter-mapping, serdfsdvlet and servlet-mapping
element must appear in the web application deployment
descriptor in that order.
Filter Life Cycle
 Methods Controlling life cycle of a filter are as follows
 init()
 doFilter()
 destroy()
 Three methods of Filter interface makes up the life cycle of a
filter.
 public void init(FilterConfig config) throws ServletException
 public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws ServletException, IOException
 public void destroy()
Thank You…

More Related Content

Similar to GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt

Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Mindfire Solutions
 
servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0megrhi haikel
 
Servlet ppt by vikas jagtap
Servlet ppt by vikas jagtapServlet ppt by vikas jagtap
Servlet ppt by vikas jagtapVikas Jagtap
 
21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMS21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMSkoolkampus
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.pptkstalin2
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptxMattMarino13
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteTushar B Kute
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01raviIITRoorkee
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3Ben Abdallah Helmi
 
Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form ...
Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form ...Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form ...
Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form ...Thomas Lee
 
Active Server Page - ( ASP )
Active Server Page - ( ASP )Active Server Page - ( ASP )
Active Server Page - ( ASP )MohitJoshi154
 

Similar to GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt (20)

Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
 
Servlets
ServletsServlets
Servlets
 
Major project report
Major project reportMajor project report
Major project report
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0servlet 2.5 & JSP 2.0
servlet 2.5 & JSP 2.0
 
Servlet ppt by vikas jagtap
Servlet ppt by vikas jagtapServlet ppt by vikas jagtap
Servlet ppt by vikas jagtap
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMS21. Application Development and Administration in DBMS
21. Application Development and Administration in DBMS
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet.ppt
Servlet.pptServlet.ppt
Servlet.ppt
 
Servlet1.ppt
Servlet1.pptServlet1.ppt
Servlet1.ppt
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptx
 
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B KuteJava Servlet Programming under Ubuntu Linux by Tushar B Kute
Java Servlet Programming under Ubuntu Linux by Tushar B Kute
 
Web services intro.
Web services intro.Web services intro.
Web services intro.
 
Day7
Day7Day7
Day7
 
Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01Anintroductiontojavawebtechnology 090324184240-phpapp01
Anintroductiontojavawebtechnology 090324184240-phpapp01
 
TY.BSc.IT Java QB U3
TY.BSc.IT Java QB U3TY.BSc.IT Java QB U3
TY.BSc.IT Java QB U3
 
SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3SCWCD : Servlet web applications : CHAP 3
SCWCD : Servlet web applications : CHAP 3
 
Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form ...
Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form ...Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form ...
Webformer: a Rapid Application Development Toolkit for Writing Ajax Web Form ...
 
Active Server Page - ( ASP )
Active Server Page - ( ASP )Active Server Page - ( ASP )
Active Server Page - ( ASP )
 

More from CUO VEERANAN VEERANAN

Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)CUO VEERANAN VEERANAN
 
Fourier Transforms are indispensable tool
Fourier Transforms are indispensable toolFourier Transforms are indispensable tool
Fourier Transforms are indispensable toolCUO VEERANAN VEERANAN
 
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.pptENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.pptCUO VEERANAN VEERANAN
 
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULINGCS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULINGCUO VEERANAN VEERANAN
 
GAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.pptGAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.pptCUO VEERANAN VEERANAN
 
Lab 3 Python Programming Lab 8-15 MKU.pdf
Lab 3 Python Programming Lab 8-15 MKU.pdfLab 3 Python Programming Lab 8-15 MKU.pdf
Lab 3 Python Programming Lab 8-15 MKU.pdfCUO VEERANAN VEERANAN
 
Lab 3 Python Programming Lab 1-8 MKU.pdf
Lab 3 Python Programming Lab 1-8 MKU.pdfLab 3 Python Programming Lab 1-8 MKU.pdf
Lab 3 Python Programming Lab 1-8 MKU.pdfCUO VEERANAN VEERANAN
 
MULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
MULTIPROCESSOR AND REAL TIME SCHEDULING.pptMULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
MULTIPROCESSOR AND REAL TIME SCHEDULING.pptCUO VEERANAN VEERANAN
 
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...CUO VEERANAN VEERANAN
 
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...CUO VEERANAN VEERANAN
 
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...CUO VEERANAN VEERANAN
 
1.1.7 Block diagram and Working Principle of Computer
1.1.7 Block diagram and Working Principle of Computer1.1.7 Block diagram and Working Principle of Computer
1.1.7 Block diagram and Working Principle of ComputerCUO VEERANAN VEERANAN
 
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
1.1.5 Terms related to Computer & 1.1.5.3 Technical IndustryCUO VEERANAN VEERANAN
 
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
1.1.5 Terms related to Computer & 1.1.5.2 Software.pptCUO VEERANAN VEERANAN
 

More from CUO VEERANAN VEERANAN (20)

Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)Big Data - large Scale data (Amazon, FB)
Big Data - large Scale data (Amazon, FB)
 
Fourier Transforms are indispensable tool
Fourier Transforms are indispensable toolFourier Transforms are indispensable tool
Fourier Transforms are indispensable tool
 
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.pptENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
ENHANCING BIOLOGICAL RESEARCH THROUGH DIGITAL TECHNOLOGIES AND COMPUTATIONAL.ppt
 
ADS_Unit I_Route Map 2023.pdf
ADS_Unit I_Route Map 2023.pdfADS_Unit I_Route Map 2023.pdf
ADS_Unit I_Route Map 2023.pdf
 
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULINGCS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
CS 23 Operating System Design Principles_MULTIPROCESSOR AND REAL TIME SCHEDULING
 
Python Unit I MCQ.ppt
Python Unit I MCQ.pptPython Unit I MCQ.ppt
Python Unit I MCQ.ppt
 
GAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.pptGAC DS Priority Queue Presentation 2022.ppt
GAC DS Priority Queue Presentation 2022.ppt
 
Lab 3 Python Programming Lab 8-15 MKU.pdf
Lab 3 Python Programming Lab 8-15 MKU.pdfLab 3 Python Programming Lab 8-15 MKU.pdf
Lab 3 Python Programming Lab 8-15 MKU.pdf
 
Lab 3 Python Programming Lab 1-8 MKU.pdf
Lab 3 Python Programming Lab 1-8 MKU.pdfLab 3 Python Programming Lab 1-8 MKU.pdf
Lab 3 Python Programming Lab 1-8 MKU.pdf
 
MULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
MULTIPROCESSOR AND REAL TIME SCHEDULING.pptMULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
MULTIPROCESSOR AND REAL TIME SCHEDULING.ppt
 
Relational Algebra.ppt
Relational Algebra.pptRelational Algebra.ppt
Relational Algebra.ppt
 
DS Unit I to III MKU Questions.pdf
DS Unit I to III MKU Questions.pdfDS Unit I to III MKU Questions.pdf
DS Unit I to III MKU Questions.pdf
 
Acharya Vinoba Bhave.ppt
Acharya Vinoba Bhave.pptAcharya Vinoba Bhave.ppt
Acharya Vinoba Bhave.ppt
 
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.3 Classification of Computers on the basis of...
 
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.2 Classification of Computers on the basis of...
 
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
1.1.8 Types of computer & 1.1.8.1 Classification of Computers on the basis of...
 
1.1.7 Block diagram and Working Principle of Computer
1.1.7 Block diagram and Working Principle of Computer1.1.7 Block diagram and Working Principle of Computer
1.1.7 Block diagram and Working Principle of Computer
 
1.1.6 Characteristics of Computer
1.1.6 Characteristics of Computer1.1.6 Characteristics of Computer
1.1.6 Characteristics of Computer
 
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
1.1.5 Terms related to Computer & 1.1.5.3 Technical Industry
 
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
1.1.5 Terms related to Computer & 1.1.5.2 Software.ppt
 

Recently uploaded

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 

Recently uploaded (20)

POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 

GAC Java Presentation_Server Side Include_Cookies_Filters 2022.ppt

  • 1. GOVERNMENT ARTS COLLEGE Melur, Madurai By Mr. V. Veeranan Roll No: P22PCS123 I M.Sc. Computer Science Topic: Server Side Include (Cookies and Filters) PG. Department of Computer Science ADVANCED JAVA PROGRAMMING
  • 2. Server Side Includes (SSI) Embed instructions to the Server Inside an HTML document HTML tag Language A special file -> .shtml SHTML -> the web server Servlets To add small of dynamic content Otherwise static HTML pages
  • 3. Server-side Includes(SSI)  Server-Side Includes (SSI) give you the ability to embed instructions to the server inside an HTML document.  The instructions are given using extensions to the HTML tag language. A special file extension,  . shtml, signals the server that the document contains SSI directives.  SHTML is a file extension that lets the web server know the file should be processed as using Server Side Includes(SSI)  Servlets are not confined to handling entire requests. Some web servers allow servlets to add small amounts of dynamic content to otherwise static HTML pages.
  • 4. Server Side Include Tag  A page that uses the advertisement servlet is written just like a normal HTML page, except that it contains one or more <SERVILET> tags and is saved with the .shtml extension. • The <SERVIET> tag is similar to the <APPLET> tag, which loads an applet within a page. When a client requests a .shtml page, the server finds all of the <SERVLET> tags in the text and replaces them with the output from the appropriate servlets. • When you use a <SERVLET> tag, you must include a CODE parameter that identifies the servlet to be loaded. This can be a class name or a servlet allas set up within the server. On some servers, you can specify an optional CODEBASE parameter that loads the servlet code from a remote location.
  • 5. Server Side Include • Any additional parameters are treated as servlet initialization parameters. Each <SERVLET> tag must be matched by a closing</SERVLET> tag. • Between the opening and closing tags, you can include as many <PARAM> tags as necessary, where you specify NAME and VALUE attributes for each one. • The servlet can them access these parameters with getParameter().
  • 6. Example (Time.shtml) <HTML> <HEAD> <TITLE> Times1</TITLE></HEAD> <BODY> The current time here is: <SERVLET CODE=CurrentTime> </SERVLET> <p> The current time in London is: <SERVLET CODE
  • 7. Cookies • Cookies is a small text file containing client information sent by a web server to a browser that can later be read back from the browser. • When a browser receives a cookie, it saves the cookie and there after sends the cookie back to the server each time it accesses a page on the server, subject to certain rules. • Since cookie’s value can uniquely identify a client, cookies are often used for session tracking. • The browser is expected to support 20 cookies for each Web server, 300 cookies total any may limit cookie size to 4kb each.
  • 9. Working with Cookies Create Cookie Class Constructor public Cookie(String name, String Value()) Create Cookie, Send -> Browser HttpServletResponce.addCookie(Cookie Cokie) Servlet -> Request HttpServletRequest.getCookies()
  • 10. Cookie Methods Specifies a Comment public void setComment(java.lang.String purpose) Comment using describing public java.lang.String getComment() Specifies the Domain name public void setDomain(java.lang.String pattern) The Maximum age -> Cookie public void setMaxAge(int expiry) Positive Vallue -> Negative value -> Zero Value Return the Maximum age -> Cookie public int setMaxAge() Set of URIs -> Client public void setPath(java.lang.String.url)
  • 11. Cookie Methods Returns the Paths public java.lang.String.getPath() Indicates to the Browser public vaid setSecure(boolean flag) Returns true if -> Browser -> Sending public Boollean getSecure()
  • 12. Filters  Filter is a component which dynamically intercepts requests and responses to transform or use the information contained in the requests or response,  Filters typically do not themselves create responses but provide universal functions that can be “attached” to any type of servlet or JSP page.  A filter is a program that runs on the server before the servlet with which it is associated.
  • 13. Benefits of Filters  Filters encapsulates common behaviour in a modular and reusable manner.  It separates high-level access decisions from presentation code.  It applies wholesale changes to many different resources.
  • 14. Types/Components of Filters Filters can perform many different types of functions. Based on their functionalities following are the filters  Authentication: Blocking requests based on user identity.  Logging and auditing: Tracking users of a web application.  Image conversion: Scaling maps and so on.  Localization: Targeting the request and response to particular locale.  XSL/T Transformations of XML Content: Targeting web application responses to more than one type of client.
  • 15. Programming a Filter  Create a class that implement the filter interface  Put the filtering behaviour in the doFilter method  Call the doFilter Method of the FilterChain object  Register the filter with the appropriate servlets and JSP pages  Disable the invoker servlet.
  • 16. Filter Element in web.xml  Icon  Filter-name  Display-name  Description  Filter-class  Init-param  Filter-Mapping Element  Filter-name  url-pattern  Servlet-name
  • 17. Process of Registering Filter with Servlet  One filter can be associated with more than one servlet.  More than one filter can be mapped to a servlet.  A filter can be mapped to all the servlet using an “*”.  The filter, filter-mapping, serdfsdvlet and servlet-mapping element must appear in the web application deployment descriptor in that order.
  • 18. Filter Life Cycle  Methods Controlling life cycle of a filter are as follows  init()  doFilter()  destroy()  Three methods of Filter interface makes up the life cycle of a filter.  public void init(FilterConfig config) throws ServletException  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws ServletException, IOException  public void destroy()

Editor's Notes

  1. Connected component