Code Comments
Programming Forum and web based access to our favorite programming groups.i want to write jsp custom tag that prints string "begin", then invokes
all jsp instructions from it's body (instructions == other tags and
scriplets), and then prints string "end". i've tried to write it by
extending SimpleTagSupport class, and coding sth like that:
public void doStartTag() throws JspException {
JspWriter out = getJspContext().getOut();
try{
out.println("begin");
getJspBody().invoke(null);
out.println("end");
} catch (IOException e) {
throw new JspTagException("RuleFileTd tag exception :" +
e.getMessage());
}
}
the class with above method compiles without errors. this is a
body-content tag of my custom tag definition in tld file i use:
<body-content>JSP</body-content>
but during execution of my jsp page tomcat gives me error saying that
body-content cannot be set to JSP while using SimpleTagSupport.
what to do now? maybe i should extend other class to write my tag? how
to implement a tag that allows other tags and scriplets in his body?
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.