From the course: Java EE: Servlets and JavaServer Pages (JSP)
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
JSP elements: Declaration
From the course: Java EE: Servlets and JavaServer Pages (JSP)
JSP elements: Declaration
- [Instructor] Now let's take a look at the declaration demo. What we are going to do is when I click on the login hyperlink on my landing page, there's a section out here which is going to display date and time for me. Now this date and time is of course going to change on a daily basis. The time may be minute basis, second basis, etc. So what we're going to do is we're going to display this date and time dynamically and all of this we're going to do with the declaration element. So let's go to the login jsp in our Eclipse. This is the login jsp and line number 38 onwards is the section which will allow me to display that date and time. Now, what I'm going to do is I'm going to go at the end of this file, and after the footer on line number 82, I'm going to open up a declaration element. Please note that the code for declaration or scriplet elements can be written anywhere on this jsp page. It really doesn't matter with the order that you're following. So let me begin a declaration…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
-
(Locked)
Understanding JSP and its features4m 57s
-
(Locked)
JSP elements: Scriptlet, declaration, and expression4m 34s
-
(Locked)
JSP elements: Scriptlet and expression9m 26s
-
(Locked)
JSP elements: Declaration4m 3s
-
(Locked)
Understanding the JSP life cycle5m 54s
-
(Locked)
JSP directives: Page8m 52s
-
(Locked)
JSP directives: Include and taglib5m 23s
-
(Locked)
Understanding implicit objects in JSP5m 12s
-
(Locked)
-
-
-
-
-