Hi Shawn. I agree that these topics need to be addressed in the tutorial.
A couple comments...
> 1) Properties are expected to remain consistent. This means that:
>
> - no user code should call a setXXX() accessor of a tag handler
Should this not be amended to be the following?
- no user code should call a setXXX() accessor corresponding to a tag
attribute.
It seems to me that I may want some setters on my tag that are outside the
attribute mechanism.
For example, if I have:
<ora:displayContents>
<ora:getContents/>
</ora:displayContents>
It might be nice to have a setContent() method in the parent tag that does
not affect a tag attribute.
This needs more thought, but I think you see what I mean....
> - tag handlers should not perform invocation-specific logic in a
> setXXX() method. That is, the setting of a property should
> have no side effects.
Might add here that the spec (JSP or the JavaBean, I believe) does not
specify an order in which the JSP container will call setters.
> Examples:
>
> a) Suppose you have a tag that accepts some sort of expression that you
> need to resolve, e.g.:
>
> <show value="$my-expression$"/>
>
> "$my-expression$" should be stored by setValue() and evaluated in
> doStartTag(). For the behavior that's almost always desired, it should
> NOT be evaluated in setValue().
I disagree somewhat with this. If you have some runtime validation of
attributes values occurring, you may want this to happen in the setters --
to short circuit the process. Why wait for doStartTag()? This would require
evaluation, but not any further processing. THoughts?
Everything else +1
Keyton