Women in Technology

Hear us Roar



Article:
  Designing JSP Custom Tag Libraries
Subject:   Typo in DoStartTag?
Date:   2001-05-30 15:34:14
From:   mdwchang
I believe there is a typo in the first out.println statement -- I'm not sure if this is causing the error the previous poster spoke about.


The line should probably be:
out.println("<table border=\"1\">");
^^
/**
* doStartTag is called by the JSP container when the tag is encountered
*/
public int doStartTag() {
try {
JspWriter out = pageContext.getOut();
out.println("<table border="\1\">");
if (name != null)
out.println("<tr><td> Hello " + name + " </td></tr>");
else
out.println("<tr><td> Hello World </td></tr>");
} catch (Exception ex) {
throw new Error("All is not well in the world.");
}
// Must return SKIP_BODY because we are not supporting a body for this
// tag.
return SKIP_BODY;
}