--
James
-------
FuseSource
Email: ja...@fusesource.com
Web: http://fusesource.com
Twitter: jstrachan, fusenews
Blog: http://macstrac.blogspot.com/
Open Source Integration and Messaging
Regards,
Hiram
FuseSource
Web: http://fusesource.com/
The reason we've not really done it yet is just the case that JSP tag
library implementations are generally a bit complex and totally depend
on the JSP APIs and so forth. Am not sure how easy it'd be to support
them perfectly out of the box; particularly as some of them assume JSP
EL stuff etc.
But I guess we could create some kinda JSP abstraction library, where
to a JSP tag Scalate pretended to be a JSP page and just exposed the
same JSP API; not sure how easy/hard it'd be though.
Using the JspTag classes written in Java code (or compiled to bytecode
via tag fragments) is probably not that hard I guess; we just need to
figure out how to call the Jsp tag construct and hide it behind a
Java/Scala tag function or something? Though often the JSP tags don't
do that much really; they are often fairly simple things - I can't
help think just writing those functions nicely in Scala would be more
productive & result in smaller code with less dependencies than
adapting JSP code into Scalate; but its worth an experiment if someone
fancies it?
It might be someone could start hacking little facades around some
useful libraries if we had a basic way to call a tag. e.g.
object MyFormLib {
def form(action: String, method: String = "POST) = {
callTag(new SomeFormTag(), Map("action" -> action, "method" -> method)
}
protected def callTag(tag: JspTag, args: Map[String,Any]) {
// call the JSP contract here depending on a JSP SimpleTag /
IterationTag / BodyTag etc)
}
}
we could maybe even add a generic method to call a JSP tag; given a
namespace & tag name - we'd just need a way to discover the tag
classes.
We'd just need to create a Scalate implementation of JspContext,
JspFragment, BodyContent et al. We'd maybe feel a bit dirty doing it,
but it'd maybe not be that hard?
--
regards
Marc Logemann