SlideShare ist ein Scribd-Unternehmen logo
1 von 23
Downloaden Sie, um offline zu lesen
Java Server Pages(JSP)
Web&java. 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
Web&java. jsp
Web&java. jsp
Web&java. jsp
Web&java. jsp
Web&java. jsp
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

Weitere ähnliche Inhalte

Was ist angesagt?

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
 

Was ist angesagt? (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
 

Andere mochten auch

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
 
Java fx for interface
Java fx for interfaceJava fx for interface
Java fx for interfaceAsya 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.fundamentals
Java.fundamentalsJava.fundamentals
Java.fundamentalsAsya Dudnik
 
использование Hibernate java persistence.part 4.
использование Hibernate java persistence.part 4.использование Hibernate java persistence.part 4.
использование Hibernate java persistence.part 4.Asya 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
 
Data bases in pictures
Data bases in picturesData bases in pictures
Data bases in picturesAsya 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
 

Andere mochten auch (20)

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
 
Java fx for interface
Java fx for interfaceJava fx for interface
Java fx for interface
 
Hibernate&ejb3 . part3.
Hibernate&ejb3 . part3.Hibernate&ejb3 . part3.
Hibernate&ejb3 . part3.
 
MVC CTPP
MVC CTPPMVC CTPP
MVC CTPP
 
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.fundamentals
Java.fundamentalsJava.fundamentals
Java.fundamentals
 
использование Hibernate java persistence.part 4.
использование Hibernate java persistence.part 4.использование Hibernate java persistence.part 4.
использование Hibernate java persistence.part 4.
 
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.
 
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. gwt
Web&java. gwtWeb&java. gwt
Web&java. gwt
 
Data bases in pictures
Data bases in picturesData bases in pictures
Data bases in pictures
 
Web&java. jsp
Web&java. jspWeb&java. jsp
Web&java. jsp
 
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
 

Ähnlich wie Web&java. jsp

Ähnlich wie 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
 

Mehr von 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
 

Mehr von 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
 

Kürzlich hochgeladen

EPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptxEPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptxJoseeMusabyimana
 
ASME BPVC 2023 Section I para leer y entender
ASME BPVC 2023 Section I para leer y entenderASME BPVC 2023 Section I para leer y entender
ASME BPVC 2023 Section I para leer y entenderjuancarlos286641
 
Landsman converter for power factor improvement
Landsman converter for power factor improvementLandsman converter for power factor improvement
Landsman converter for power factor improvementVijayMuni2
 
Power System electrical and electronics .pptx
Power System electrical and electronics .pptxPower System electrical and electronics .pptx
Power System electrical and electronics .pptxMUKULKUMAR210
 
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratoryدليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide LaboratoryBahzad5
 
cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabusViolet Violet
 
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
Engineering Mechanics  Chapter 5  Equilibrium of a Rigid BodyEngineering Mechanics  Chapter 5  Equilibrium of a Rigid Body
Engineering Mechanics Chapter 5 Equilibrium of a Rigid BodyAhmadHajasad2
 
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...Amil baba
 
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Sean Meyn
 
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchrohitcse52
 
Test of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptxTest of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptxHome
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfodunowoeminence2019
 
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...soginsider
 
Nodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptxNodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptxwendy cai
 
Guardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSecGuardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSecTrupti Shiralkar, CISSP
 
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxLMW Machine Tool Division
 

Kürzlich hochgeladen (20)

EPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptxEPE3163_Hydro power stations_Unit2_Lect2.pptx
EPE3163_Hydro power stations_Unit2_Lect2.pptx
 
ASME BPVC 2023 Section I para leer y entender
ASME BPVC 2023 Section I para leer y entenderASME BPVC 2023 Section I para leer y entender
ASME BPVC 2023 Section I para leer y entender
 
Présentation IIRB 2024 Marine Cordonnier.pdf
Présentation IIRB 2024 Marine Cordonnier.pdfPrésentation IIRB 2024 Marine Cordonnier.pdf
Présentation IIRB 2024 Marine Cordonnier.pdf
 
Landsman converter for power factor improvement
Landsman converter for power factor improvementLandsman converter for power factor improvement
Landsman converter for power factor improvement
 
Power System electrical and electronics .pptx
Power System electrical and electronics .pptxPower System electrical and electronics .pptx
Power System electrical and electronics .pptx
 
Lecture 2 .pdf
Lecture 2                           .pdfLecture 2                           .pdf
Lecture 2 .pdf
 
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratoryدليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
دليل تجارب الاسفلت المختبرية - Asphalt Experiments Guide Laboratory
 
cloud computing notes for anna university syllabus
cloud computing notes for anna university syllabuscloud computing notes for anna university syllabus
cloud computing notes for anna university syllabus
 
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
Engineering Mechanics  Chapter 5  Equilibrium of a Rigid BodyEngineering Mechanics  Chapter 5  Equilibrium of a Rigid Body
Engineering Mechanics Chapter 5 Equilibrium of a Rigid Body
 
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
Popular-NO1 Kala Jadu Expert Specialist In Germany Kala Jadu Expert Specialis...
 
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
Quasi-Stochastic Approximation: Algorithm Design Principles with Applications...
 
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
 
Lecture 4 .pdf
Lecture 4                              .pdfLecture 4                              .pdf
Lecture 4 .pdf
 
Litature Review: Research Paper work for Engineering
Litature Review: Research Paper work for EngineeringLitature Review: Research Paper work for Engineering
Litature Review: Research Paper work for Engineering
 
Test of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptxTest of Significance of Large Samples for Mean = µ.pptx
Test of Significance of Large Samples for Mean = µ.pptx
 
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdfRenewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
Renewable Energy & Entrepreneurship Workshop_21Feb2024.pdf
 
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...Transforming Process Safety Management: Challenges, Benefits, and Transition ...
Transforming Process Safety Management: Challenges, Benefits, and Transition ...
 
Nodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptxNodal seismic construction requirements.pptx
Nodal seismic construction requirements.pptx
 
Guardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSecGuardians and Glitches: Navigating the Duality of Gen AI in AppSec
Guardians and Glitches: Navigating the Duality of Gen AI in AppSec
 
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptxVertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
Vertical- Machining - Center - VMC -LMW-Machine-Tool-Division.pptx
 

Web&java. jsp

  • 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