Professional Documents
Culture Documents
Prog315 - Lecture 5 - 2024 - JSP
Prog315 - Lecture 5 - 2024 - JSP
LECTURE 5 - AIOOP23111
Java Server Pages
LECTURE 5 & 6 - JAVA SERVER PAGES
Associate Degree in Information Technology
AIOOP23111- OBJECT ORIENTED PROGRAMMING 2
Year 3_Semester: 05
From Jan 2024 to May 2024
Scripting element-directive
• These tags are used to provide specific instructions to the
web container when the page is translated.
• provide directions and instructions to the container, telling it
how to handle certain aspects of the JSP processing
• For example, a directive can be used to import java classes.
• The three subcategories for directives are:
-Page: <%@ page ... %>
-Include: <%@ include ... %>
-Taglib: <%@ taglib ... %>
LECTURE 5 & 6 - JAVA SERVER PAGES
Associate Degree in Information Technology
AIOOP23111- OBJECT ORIENTED PROGRAMMING 2
Year 3_Semester: 05
From Jan 2024 to May 2024
Scripting element-Scriptlets
• scriptlet tag allows writing Java code
statements within the JSP page
• it evaluates your Java expression but does not
print or show your result in conjunction with
the HTML created.
LECTURE 5 & 6 - JAVA SERVER PAGES
Associate Degree in Information Technology
AIOOP23111- OBJECT ORIENTED PROGRAMMING 2
Year 3_Semester: 05
From Jan 2024 to May 2024
Scripting element-Expression
• are responsible for containing scripting language expression,
which gets evaluated and converted to Strings by the JSP
engine.
• mostly used for printing the values of variables or methods in
the form of output.
• you are not required to write out.print() for writing your data
• Example
-in java we use system.out.print (“im printing”);
-in jsp we use <% im print %>
LECTURE 5 & 6 - JAVA SERVER PAGES
Associate Degree in Information Technology
AIOOP23111- OBJECT ORIENTED PROGRAMMING 2
Year 3_Semester: 05
From Jan 2024 to May 2024
• https://drive.google.com/file/d/1RqTuDtwCTsP
YZdAw1evv9nmg5GdboFle/view?usp=drive_lin
k
LECTURE 5 & 6 - JAVA SERVER PAGES
Associate Degree in Information Technology
AIOOP23111- OBJECT ORIENTED PROGRAMMING 2
Year 3_Semester: 05
From Jan 2024 to May 2024
Example 2
• Then do the following example
• Create a JSP page that will have the following
-display a date
-a button that will take you to the login
page
-that will include information from the
myinclude page
LECTURE 5 & 6 - JAVA SERVER PAGES
Associate Degree in Information Technology
AIOOP23111- OBJECT ORIENTED PROGRAMMING 2
Year 3_Semester: 05
From Jan 2024 to May 2024
Resources
• J2EE Developer’s Guide –
http://java.sun.com/j2ee/j2sdkee/techdocs/gui
des/ejb/html/DevGuideTOC.html
• J2EE Tutorial –
http://java.sun.com/j2ee/tutorial/1_3-fcs/index
.html
• Server Side Programming –
http://www.theserverside.com