SlideShare a Scribd company logo
1 of 23
Java Server Pages(JSP)
JavaServer Pages (JSP)
позволяют вам отделить
динамическую часть ваших
страниц от статического HTML.
Вы, как обычно, пишете обычный
код в HTML, используя для этого
любую программу для создания
Web страниц. Затем вы
заключаете динамическую часть
кода в специальные таги,
большинство которых начинаются
с "<%" и завершаются "%>".
Жизненный цикл jsp
First jsp
<html>
<head>
<title>
Hello World Sample
</title>
</head>
<body>
<h1>
<%
String name = request.getParameter("name");
if (name == null || name.length() == 0) {
%>
Hello, world !
<% } else {
%>
Hello, world ! I'm <%= name%>
<%
}
%>
</h1>
</body>
</html>
Структура каталога web-app в
каталоге src.
Синтаксис jsp.
The Scriptlet:<% code fragment %>
<html>
<head>
<title>Hello World</title></head>
<body> Hello World!<br/> <%
out.println("Your IP address is " +
request.getRemoteAddr()); %>
</body>
</html>
JSP Declarations:
<%! declaration; [ declaration; ]
+ ... %>
<%! int i = 0; %>
<%! int a, b, c; %>
<%! Circle a = new Circle(2.0); %>
JSP Expression:
<%= expression %>
<html>
<head>
<title>A Comment Test</title></head>
<body>
<p> Today's date: <%= (new
java.util.Date()).toLocaleString()%> </p>
</body> </html>
Today's date: 21-Sep-2015 21:24:25
JSP Comments:
<%-- This is JSP comment --%>
<html>
<head>
<title>A Comment test</title></head>
<body>
<h2>A Test of Comments</h2>
<%-- This comment will not be visible in
the page source --%>
</body>
</html>
JSP Directives:
<%@ directive attribute="value"
%>
<%@ page ... %>Defines page-
dependent attributes, such as
scripting language, error page, and
buffering requirements.
<%@ include ... %>Includes a file
during the translation phase.
<%@ taglib ... %>Declares a tag
library, containing custom actions,
used in the page
JSP Actions:
<jsp:action_name attribute="value" />
jsp:include Includes a file at the time the page is
requested
jsp:useBean Finds or instantiates a JavaBean
jsp:setProperty Sets the property of a JavaBean
jsp:getProperty Inserts the property of a
JavaBean into the output
jsp:forward Forwards the requester to a new page
jsp:plugin Generates browser-specific code that
makes an OBJECT or EMBED tag for the Java
plugin
jsp:element Defines XML elements dynamically.
jsp:attribute Defines dynamically defined XML
element's attribute.
jsp:body Defines dynamically defined XML
element's body.
jsp:text Use to write template text in JSP pages
and documents.
JSP Implicit Objects:
request This is the HttpServletRequest object
associated with the request.
response This is the HttpServletResponse object
associated with the response to the client.
out This is the PrintWriter object used to send output to
the client.
session This is the HttpSession object associated with
the request.
application This is the ServletContext object associated
with application context.
config This is the ServletConfig object associated with
the page.
pageContext This encapsulates use of server-specific
features like higher performance JspWriters.
page This is simply a synonym for this, and is used to
call the methods defined by the translated servlet class.
Exception The Exception object allows the exception
data to be accessed by designated JSP.
Простой проект с xml-базой
данных и jsp
Database in xml-file
Result
Link on project
https://sourceforge.net/p/jspexamplelogin/code/
Literature
http://www.javatpoint.com/login-form-in-jsp#
http://java-course.ru/student/book1/jsp/
http://www.tutorialspoint.com/jsp/jsp_syntax.htm
http://www.codenet.ru/webmast/java/jsp.php

More Related Content

What's hot

Ch. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryCh. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryManolis Vavalis
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Ayes Chinmay
 
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)JavaEE Trainers
 
MVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web ApplicationsMVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web ApplicationsVforce Infotech
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JSAkshay Mathur
 
Jsp , javasportal, jsp basic,
Jsp , javasportal, jsp basic, Jsp , javasportal, jsp basic,
Jsp , javasportal, jsp basic, rupendra1817
 
Intro to Javascript and jQuery
Intro to Javascript and jQueryIntro to Javascript and jQuery
Intro to Javascript and jQueryShawn Calvert
 
Utilization of zend an ultimate alternate for intense data processing
Utilization of zend  an ultimate alternate for intense data processingUtilization of zend  an ultimate alternate for intense data processing
Utilization of zend an ultimate alternate for intense data processingCareer at Elsner
 
Filters in AngularJS
Filters in AngularJSFilters in AngularJS
Filters in AngularJSBrajesh Yadav
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery BasicsKaloyan Kosev
 
Controller in AngularJS
Controller in AngularJSController in AngularJS
Controller in AngularJSBrajesh Yadav
 

What's hot (20)

Jsp & struts
Jsp & strutsJsp & struts
Jsp & struts
 
Ch. 9 jsp standard tag library
Ch. 9 jsp standard tag libraryCh. 9 jsp standard tag library
Ch. 9 jsp standard tag library
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
 
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
Servlet/JSP course chapter 2: Introduction to JavaServer Pages (JSP)
 
MVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web ApplicationsMVC Frameworks for building PHP Web Applications
MVC Frameworks for building PHP Web Applications
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JS
 
J Query
J QueryJ Query
J Query
 
Ch. 7 beeing a jsp
Ch. 7 beeing a jsp     Ch. 7 beeing a jsp
Ch. 7 beeing a jsp
 
Jsp , javasportal, jsp basic,
Jsp , javasportal, jsp basic, Jsp , javasportal, jsp basic,
Jsp , javasportal, jsp basic,
 
jQuery basics
jQuery basicsjQuery basics
jQuery basics
 
Intro to Javascript and jQuery
Intro to Javascript and jQueryIntro to Javascript and jQuery
Intro to Javascript and jQuery
 
Learning jsp
Learning jspLearning jsp
Learning jsp
 
Built in filters
Built in filtersBuilt in filters
Built in filters
 
Utilization of zend an ultimate alternate for intense data processing
Utilization of zend  an ultimate alternate for intense data processingUtilization of zend  an ultimate alternate for intense data processing
Utilization of zend an ultimate alternate for intense data processing
 
Filters in AngularJS
Filters in AngularJSFilters in AngularJS
Filters in AngularJS
 
JSP
JSPJSP
JSP
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery Basics
 
Intro to jQuery
Intro to jQueryIntro to jQuery
Intro to jQuery
 
Controller in AngularJS
Controller in AngularJSController in AngularJS
Controller in AngularJS
 
4. jsp
4. jsp4. jsp
4. jsp
 

Viewers also liked

Java fx for interface
Java fx for interfaceJava fx for interface
Java fx for interfaceAsya Dudnik
 
Data bases in pictures
Data bases in picturesData bases in pictures
Data bases in picturesAsya Dudnik
 
Hibernate&ejb3 . part3.
Hibernate&ejb3 . part3.Hibernate&ejb3 . part3.
Hibernate&ejb3 . part3.Asya Dudnik
 
Work with my_sql_-_database_in_java
Work with my_sql_-_database_in_javaWork with my_sql_-_database_in_java
Work with my_sql_-_database_in_javaAsya Dudnik
 
Java fx for interface
Java fx for interfaceJava fx for interface
Java fx for interfaceAsya Dudnik
 
Work with my sql database in java
Work with my sql   database in javaWork with my sql   database in java
Work with my sql database in javaAsya Dudnik
 
использование Hibernate java persistence.part 4.
использование Hibernate java persistence.part 4.использование Hibernate java persistence.part 4.
использование Hibernate java persistence.part 4.Asya Dudnik
 
Java.fundamentals
Java.fundamentalsJava.fundamentals
Java.fundamentalsAsya Dudnik
 
Get started with docker &amp; dev ops
Get started with docker &amp; dev opsGet started with docker &amp; dev ops
Get started with docker &amp; dev opsAsya Dudnik
 
Apache maven in java projects
Apache maven in java projectsApache maven in java projects
Apache maven in java projectsAsya Dudnik
 
Java.fundamentals
Java.fundamentalsJava.fundamentals
Java.fundamentalsAsya Dudnik
 
Work with xml in java
Work with xml in javaWork with xml in java
Work with xml in javaAsya Dudnik
 
Get started with docker &amp; dev ops
Get started with docker &amp; dev opsGet started with docker &amp; dev ops
Get started with docker &amp; dev opsAsya Dudnik
 
использование Hibernate java persistence.part 2.
использование Hibernate java persistence.part 2.использование Hibernate java persistence.part 2.
использование Hibernate java persistence.part 2.Asya Dudnik
 

Viewers also liked (20)

Java fx for interface
Java fx for interfaceJava fx for interface
Java fx for interface
 
Web&java.jsf.
Web&java.jsf.Web&java.jsf.
Web&java.jsf.
 
Data bases in pictures
Data bases in picturesData bases in pictures
Data bases in pictures
 
Hibernate&ejb3 . part3.
Hibernate&ejb3 . part3.Hibernate&ejb3 . part3.
Hibernate&ejb3 . part3.
 
Web&java. gwt
Web&java. gwtWeb&java. gwt
Web&java. gwt
 
Work with my_sql_-_database_in_java
Work with my_sql_-_database_in_javaWork with my_sql_-_database_in_java
Work with my_sql_-_database_in_java
 
Java fx for interface
Java fx for interfaceJava fx for interface
Java fx for interface
 
Work with my sql database in java
Work with my sql   database in javaWork with my sql   database in java
Work with my sql database in java
 
Web&java. jsp
Web&java. jspWeb&java. jsp
Web&java. jsp
 
использование Hibernate java persistence.part 4.
использование Hibernate java persistence.part 4.использование Hibernate java persistence.part 4.
использование Hibernate java persistence.part 4.
 
Java.fundamentals
Java.fundamentalsJava.fundamentals
Java.fundamentals
 
MVC CTPP
MVC CTPPMVC CTPP
MVC CTPP
 
Get started with docker &amp; dev ops
Get started with docker &amp; dev opsGet started with docker &amp; dev ops
Get started with docker &amp; dev ops
 
Apache maven in java projects
Apache maven in java projectsApache maven in java projects
Apache maven in java projects
 
Java.fundamentals
Java.fundamentalsJava.fundamentals
Java.fundamentals
 
Oracle database
Oracle databaseOracle database
Oracle database
 
Work with xml in java
Work with xml in javaWork with xml in java
Work with xml in java
 
Get started with docker &amp; dev ops
Get started with docker &amp; dev opsGet started with docker &amp; dev ops
Get started with docker &amp; dev ops
 
использование Hibernate java persistence.part 2.
использование Hibernate java persistence.part 2.использование Hibernate java persistence.part 2.
использование Hibernate java persistence.part 2.
 
Jdbc in java
Jdbc in javaJdbc in java
Jdbc in java
 

Similar to Web&java. jsp

Similar to Web&java. jsp (20)

JSP - Java Server Page
JSP - Java Server PageJSP - Java Server Page
JSP - Java Server Page
 
Introduction to JSP.pptx
Introduction to JSP.pptxIntroduction to JSP.pptx
Introduction to JSP.pptx
 
JSP.pptx
JSP.pptxJSP.pptx
JSP.pptx
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
 
JSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGESJSP- JAVA SERVER PAGES
JSP- JAVA SERVER PAGES
 
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-14) [JSP] | NIC/NIELIT Web Technology
 
DataBase Connectivity
DataBase ConnectivityDataBase Connectivity
DataBase Connectivity
 
KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 5/7KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 5/7
 
KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 5/7KMUTNB - Internet Programming 5/7
KMUTNB - Internet Programming 5/7
 
Jsp in Servlet by Rj
Jsp in Servlet by RjJsp in Servlet by Rj
Jsp in Servlet by Rj
 
J2EE jsp_01
J2EE jsp_01J2EE jsp_01
J2EE jsp_01
 
JavaServer Pages
JavaServer PagesJavaServer Pages
JavaServer Pages
 
Chap4 4 2
Chap4 4 2Chap4 4 2
Chap4 4 2
 
Jsp and jstl
Jsp and jstlJsp and jstl
Jsp and jstl
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Unit 4 web technology uptu
Unit 4 web technology uptuUnit 4 web technology uptu
Unit 4 web technology uptu
 
Unit 4 1 web technology uptu
Unit 4 1 web technology uptuUnit 4 1 web technology uptu
Unit 4 1 web technology uptu
 
JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)JAVA EE DEVELOPMENT (JSP and Servlets)
JAVA EE DEVELOPMENT (JSP and Servlets)
 
Jsp sasidhar
Jsp sasidharJsp sasidhar
Jsp sasidhar
 
3.jsp tutorial
3.jsp tutorial3.jsp tutorial
3.jsp tutorial
 

More from Asya Dudnik

Ejb in java. part 1.
Ejb in java. part 1.Ejb in java. part 1.
Ejb in java. part 1.Asya Dudnik
 
Work with xml in java
Work with xml in javaWork with xml in java
Work with xml in javaAsya Dudnik
 
использование Hibernate java persistence.part 1.
использование Hibernate java persistence.part 1.использование Hibernate java persistence.part 1.
использование Hibernate java persistence.part 1.Asya Dudnik
 
Usage concurrence in java
Usage concurrence in javaUsage concurrence in java
Usage concurrence in javaAsya Dudnik
 

More from Asya Dudnik (7)

Threads in java
Threads in javaThreads in java
Threads in java
 
Ejb in java. part 1.
Ejb in java. part 1.Ejb in java. part 1.
Ejb in java. part 1.
 
Work with xml in java
Work with xml in javaWork with xml in java
Work with xml in java
 
использование Hibernate java persistence.part 1.
использование Hibernate java persistence.part 1.использование Hibernate java persistence.part 1.
использование Hibernate java persistence.part 1.
 
Usage concurrence in java
Usage concurrence in javaUsage concurrence in java
Usage concurrence in java
 
Work with UML
Work with UMLWork with UML
Work with UML
 
Spring in java
Spring in javaSpring in java
Spring in java
 

Recently uploaded

Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxLigayaBacuel1
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 

Recently uploaded (20)

Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
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🔝
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
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
 
Planning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptxPlanning a health career 4th Quarter.pptx
Planning a health career 4th Quarter.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 

Web&java. jsp

  • 2.
  • 3. JavaServer Pages (JSP) позволяют вам отделить динамическую часть ваших страниц от статического HTML. Вы, как обычно, пишете обычный код в HTML, используя для этого любую программу для создания Web страниц. Затем вы заключаете динамическую часть кода в специальные таги, большинство которых начинаются с "<%" и завершаются "%>".
  • 5. First jsp <html> <head> <title> Hello World Sample </title> </head> <body> <h1> <% String name = request.getParameter("name"); if (name == null || name.length() == 0) { %> Hello, world ! <% } else { %> Hello, world ! I'm <%= name%> <% } %> </h1> </body> </html>
  • 7. Синтаксис jsp. The Scriptlet:<% code fragment %> <html> <head> <title>Hello World</title></head> <body> Hello World!<br/> <% out.println("Your IP address is " + request.getRemoteAddr()); %> </body> </html>
  • 8. JSP Declarations: <%! declaration; [ declaration; ] + ... %> <%! int i = 0; %> <%! int a, b, c; %> <%! Circle a = new Circle(2.0); %>
  • 9. JSP Expression: <%= expression %> <html> <head> <title>A Comment Test</title></head> <body> <p> Today's date: <%= (new java.util.Date()).toLocaleString()%> </p> </body> </html> Today's date: 21-Sep-2015 21:24:25
  • 10. JSP Comments: <%-- This is JSP comment --%> <html> <head> <title>A Comment test</title></head> <body> <h2>A Test of Comments</h2> <%-- This comment will not be visible in the page source --%> </body> </html>
  • 11. JSP Directives: <%@ directive attribute="value" %> <%@ page ... %>Defines page- dependent attributes, such as scripting language, error page, and buffering requirements. <%@ include ... %>Includes a file during the translation phase. <%@ taglib ... %>Declares a tag library, containing custom actions, used in the page
  • 12. JSP Actions: <jsp:action_name attribute="value" /> jsp:include Includes a file at the time the page is requested jsp:useBean Finds or instantiates a JavaBean jsp:setProperty Sets the property of a JavaBean jsp:getProperty Inserts the property of a JavaBean into the output jsp:forward Forwards the requester to a new page jsp:plugin Generates browser-specific code that makes an OBJECT or EMBED tag for the Java plugin jsp:element Defines XML elements dynamically. jsp:attribute Defines dynamically defined XML element's attribute. jsp:body Defines dynamically defined XML element's body. jsp:text Use to write template text in JSP pages and documents.
  • 13. JSP Implicit Objects: request This is the HttpServletRequest object associated with the request. response This is the HttpServletResponse object associated with the response to the client. out This is the PrintWriter object used to send output to the client. session This is the HttpSession object associated with the request. application This is the ServletContext object associated with application context. config This is the ServletConfig object associated with the page. pageContext This encapsulates use of server-specific features like higher performance JspWriters. page This is simply a synonym for this, and is used to call the methods defined by the translated servlet class. Exception The Exception object allows the exception data to be accessed by designated JSP.
  • 14. Простой проект с xml-базой данных и jsp
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.