ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott "M." Stirling <sstirl...@mediaone.net>
Subject Re: Interfacing with Ant in JSP
Date Thu, 11 Jan 2001 06:00:11 GMT
Peter,

This rocks!  Thanks for this response.  It's good someone else realizes
this is a) a good idea (the abstract idea we're both hitting on), and b)
not a piece of cake to re-use existing task classes without the Project
context.  So far the suggestions I've gotten from others have been of
the "just do it this way..." variety, but no less half-baked than my own
ideas.

I'd heard of Avalon, but no clue what it was.  I'm reading up on that at
java.apache.org.

I tried to just build myrmidon by executing the buildfile, but that
didn't work.  Looks like I need Avalon and maybe some other stuff to
compile.  Any hints appreciated.  I have all the jars I need for
building the latest Ant, Catalina, etc.  So if it's a Jakarta project, I
usually first try my luck with the existing CLASSPATH in my antrc., then
start digging/asking.

Anyway, a couple specific points answered below.  I have some reading to
do and then I'll catch up more.

On 11 Jan 2001 14:00:30 +1100, Peter Donald wrote:
> At 09:46  10/1/01 -0500, Scott Stirling wrote:
> >1. Make all (give or take a few) of the Ant tasks available as stand-alone
> >JSP custom actions (no Project context required), 
> 
> Unfortunately we can't for Ant1.x for backwards compatability reasons but
> thats precisely the thing I advocated ages ago when I first joined the ant
> list - it was ignored then because it was so different but hopefully now I
> have it in the myrmidon proposal it may get in ;)

Well, I was looking at scenario 1 (below) and implementing tasks as JSP
tags, completely ripped away from Ant and modified to be JSP tag handler
classes instead of Tasks.  So there's no backward compatibility issue in
my mind.  In a sense, the scenario 1 (below, from my first email) is
almost like a fork of Ant, except it's not because it's more like a rape
and pillage of Ant, leaving the carcass behind.

> >converting Ant behaviors
> >to JSP behaviors where appropriate. Examples of changes to make Ant tasks
> >more like JSP tags are 1) output stream handling -- either JspWriter or
> >ServletContext.log() instead of System.out, 
> 
> Again this abstraction is done in myrmidon proposal via Logger abstraction.

Nice.

> >and 2) throwing JspTagExceptions
> >in places where an Ant task would throw a BuildException.
> 
> I am not sure this is the right thing to do. Are JspTagExceptions
> RuntimeExceptions or just normal exceptions ?


I think it's the right thing to do in the case where you want a task's
functionality, but you want the exception thrown to be one from the JSP
tag API.  JspExceptions and their kids, JspTagExceptions, are regular
Exceptions.  BuildExceptions would be appropriate for the scenario 2,
where Ant tasks are used in the more traditional, project /target
/workspace-oriented manner.

> >and 2) task-tags can take sub-tags
> >where appropriate, such as <property> or <fileset> elements.
> 
> Have it implemented in myrmidon but I didn't check it in because it is
> those evil if/else tags but I can check it in if you want ?

I'd like to see that.  

Thanks again, Pete.  You've given me some good food for thought.

Best regards,

Scott Stirling
West Newton, MA


Mime
View raw message