Download presentation
Presentation is loading. Please wait.
1
JSP Thanks to http://courses.coreservlets.com/ Course-Materials/csajsp2.html
2
The 10 most popular sites (Summer.10)
3
Keywords in job posting
4
Java Web Technology in… AIRLINES
5
Java Web Technology in… TRAVEL
6
Java Web Technology in… FINANCIAL SERVICES
7
Java Web Technology in… RETAIL
8
Java Web Technology in… SEARCH PORTALS
9
Servlets pros and cons
10
JSP - The idea
11
JSP advantages
12
JSP Lifecycle Browser Servlet generato Servlet compilato Pagina JSP Server Web
13
JSP - MISCONCEPTIONS
14
What happens when?
15
Event table
16
Syntactic elements: JSP nuts and bolts Implicit Objects: request response pageContext session application out config page
17
Syntactic elements: Interaction with the CONTAINER In the initialization of the JSP In the service method JSP nuts and bolts
18
Two sintaxes - why?
19
xml syntax for HTML4 files
20
XML syntax for XHTML files
21
JSP expressions
22
How is it translated?
23
Example
24
Predefined variables
25
Example
26
Scope of the predefined variables
27
Scriptlets
28
How gets is translated?
29
Example
30
A scriptlet does NOT need to be a complete Java expression
31
JSP declarations
32
How gets it translated? 1
33
How gets it translated - 2
34
Example
35
jspInit - jspDestroy
36
Let's recap…
37
import page directive
38
contentType -pageEncoding
39
Session
40
Error page
41
isErrorPage
42
isThreadSafe Don't you be lazy….
43
What's wrong here?
44
Should you use "isThreadSafe" ?
45
@include
46
jsp:include
47
jsp:include vs @ include
48
Augmenting request params
49
Static pages To let Tomcat serve static pages, we must define a “ Web Application ”. That is, in the Tomcat Document Root (by default $CATALINA_HOME/webapps/) we must create a folder named after our Web Application (e.g. myApp). In that “ myApp ” folder, we MUST create a WEB-INF folder (that can be empy). In the myApp folder we can then depost the static html files. On our Tomcat server, the URL for the hello.html file becomes: http://machine/port/myApp/hello.html To actually see the webapp, we might have to restart Tomcat myApp hello.html WEB-INF webapps web.xml
50
JSP pages To let Tomcat serve JSP pages, we follow the same procedure that we described for static pages. In the myApp folder we can depost the JSP files. On our Tomcat server, the URL for the hello.jsp file becomes: http://machine/port/myApp/hello.jsp The WEB-INF directory is still empty. To actually see the webapp, you might have to restart Tomcat (depending on the version you have) The same web.xml file as in the static case must be provided. myApp hello.jsp WEB-INF webapps web.xml
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.