You can watch the high resolution, full screen videos here:
http://www.thebookonhibernate.com/j2ee/index.jsp?link=07customtags
Creating Your Own Custom JSP Tags
This free, multimedia tutorial shows you how to use IBM's Rational Application Developer (IRAD) 6.0 to create a custom tag library (well, one custom tag, so it is a pretty impoverished library), and the corresponding Java code and tld file to make a custom tag work on a JSP page.
If you found something helpful here, please do your part and help support the site. Link to us, buy some books, support our sponsors, tell your developer friends about us, and remember: Happy Java!
package com.examscam.servlet.tags;
import java.io.IOException;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.TagSupport;
import com.examscam.common.Timer;
public class TimerTag extends TagSupport {
public int doStartTag() throws JspException {
JspWriter out = pageContext.getOut();
ServletRequest request = pageContext.getRequest();
ServletResponse response = pageContext.getResponse();
ServletContext application = pageContext.getServletContext();
HttpSession session = pageContext.getSession();
Timer t = (Timer)session.getAttribute("timer");
if (t==null){
t = new Timer();
session.setAttribute("timer", t);
}
try {
out.print("Elapsed Time: " + t.getElapsedTime());
out.print("Start Time: " + t.getStartTime());
} catch (IOException e) { e.printStackTrace();
} return SKIP_BODY;
}
}
Please check out my SCJA Java Certification Mock Exam website:
http://www.scja.com/associate/
And for Hibernate and JPA tutorials, check out:
http://www.thebookonhibernate.com
http://www.scja.com/j2ee/index.jsp?link=03httpsessionswf
Its tag library descriptor not tag library defination.
Akshayphadke 11 months ago
great video very helpful...you sound like stewie at 7:36 was that intentional :)
jammyjo610 2 years ago
if somebudy can help me...i want to make one jsp page with html table populated from database , and i want in every row of table two buttons: delete and edit, and on click i want some action in that row i am new in jsp/java pls help me if you have some examples =]
igor86SRB 2 years ago
awesome! no annoying typing sound effect!!
WestFlipian 3 years ago