Nic Werner wrote:
I'm writing a custom tag, and using 'JavaServer Pages' as a good guide. Its helpful, but I'm confused about the difference between Simple Tag Handlers and Classic ones.
The book states that a Simple handler 'cannot contain Java code (scripting elements)', but I'm seeing Java in these examples. What is the difference between scripting elements and just the straight Java?

The book states, for simple tag handlers that "the _body_ of a custom action implemented as a simple tag handler cannot contain Java code (scripting elements); the tag handler class itself is, of course, written in Java (or alternatively, as a tag file).

So, if you implement the tag handler as a simple tag handler, you
can not put scripting elements in the corresponding action element
in the JSP page, i.e., this is invalid:

  <foo:mySimpleTagHandler>
     <% Syste,out.println("This is invalid") %>
  </foo:mySimpleTagHandler>

If you instead implement it as a classic tag handler, the above
is valid (but not recommended; avoid scripting elements in all
pages).

Hans
--
Hans Bergsten                                  <[EMAIL PROTECTED]>
Gefion Software                       <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 2.0 and JSTL 1.1
Author of O'Reilly's "JavaServer Faces", covering JSF 1.0
Details at                              <http://www.hansbergsten.com/>


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to