From the course: Java EE: Servlets and JavaServer Pages (JSP)
Unlock the full course today
Join today to access over 22,500 courses taught by industry experts or purchase this course individually.
Custom tag: Use tag on JSP
From the course: Java EE: Servlets and JavaServer Pages (JSP)
Custom tag: Use tag on JSP
- [Instructor] Okay, so now, let's go ahead on, we are on profile.jsp and what we're going to do is, we are going to include our tag library and only way to do it is using taglib directives, so I'm going to say, at the rate taglib... and I will give it a URI first. The URI can be picked up from the TLD file. So, if you see on line number 11, you've defined the URI, so you can just take that, copy and paste it on profile.jsp. And once we do that, we also give it a prefix. You're free to give any prefix, so myTags, that's the one. Right now that's on line number four that we have included the custom tag library on our page. Now, let's go ahead, take this prefix, go down, and on line number 37 I'm just going to use this tag. So I'll say an angle bracket, myTags, and there you see you have that tag already now coming in the form of the assist feature of Eclipse. So, I'm going to just take that and then go ahead and define those two attributes. Do you see that? Date and format. So let's…
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.