See intermixed...

| Date:    Thu, 28 Oct 1999 12:48:44 -0400
| From:    Kevin Riff <[EMAIL PROTECTED]>
| Subject: Please explain some things to me
|
| I have some questions, mostly in regards to JSP tag extensions, that I
| hope someone can answer:
|
| 1 - What is the difference between JspException and JspError?
| JspException is described as "A generic exception known to the JSP
| engine" while JspError indicates that it will cause the error page to be
| displayed. But the error page will be displayed when ANY exception is
| thrown so why is JspError necessary.

JspError is a misnomer and actually is one of the few spec bugs that
still remain in PR2; they are fixed in our latest internal spec & RI.
The final name is JspTagException.

JspTagException is an exception raised by a tag handler.  It will be
caught by the top-level catch of the JSP page.  JspTagException is not
strictly necessary but we added it so we can later add other
subclasses of JspException with more specialized semantics.

| 2 - On a related note, why is it that Tag.doStartTag() and
| Tag.doEndTag() may throw JspException but BodyTag.doInitBody() and
| BodyTag.doAfterBody() may only throw JspError?

That is the other main bug in PR2.  It was an oversight.  We have
fixed it.  These methods in both interfaces and base classes now
"throw JspException".

| 3 - Why is it that tag handlers that implement BodyTag must return
| EVAL_BODY_TAG from doStartTag() while those that don't implement BodyTag
| must return EVAL_BODY_INCLUDE? Isn't the fact that the tag handler
| implements BodyTag enough to indicate to the JSP engine that the
| EVAL_BODY_TAG semantics must be used?

Could have been done this way.  But it seemed better to explicitly
make the author spell out what semantics it wants; having the
semantics depend on an interface felt just a bit dangerous.

We also wanted to keep extra flexibility down the road.

Again, a minor detail; it could have been done the other way.

Good questions.

        - eduard/o

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to