You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Schumeyer <rs...@ieee.org> on 2006/10/11 05:26:54 UTC

newbie confused by struts and ant

I'm trying to get into the struts game, which means I'm simultaneously 
trying to come up to speed on at least three Apache projects: tomcat, 
ant, and struts.  Plus servlets and jsps.  I'm sorry if this is a basic 
question, but I'm a little flustered.

Ant seems to expect a certain directory structure under the build.xml.  
I'm not sure if this it *has* to be this way or if the underlying 
directory structure is configurable.  As far as I can tell, ant wants 
something like:

./build.xml
./build.properties
./src: (all java files go here, under something like 
com.mycompany.whatever )
./web:
./web/WEB-INF:

But the example mailreader application looks like this: (some stuff 
ommitted)

./WEB-INF:
./WEB-INF/classes:
./WEB-INF/classes/*:
./WEB-INF/entities:
./WEB-INF/lib:
./WEB-INF/src:
./WEB-INF/src/java:
./WEB-INF/src/java/*:  all java files are here

So my question is, what am I missing?  Surely ant must be able to 
compile the default struts applications, which probably means I need a 
different build.xml file.  However, I haven't found any guidance on this 
matter by searching the apache site.

Any help is appreciated!




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [OT] newbie confused by struts and ant

Posted by Laurie Harper <la...@holoweb.net>.
Marked off-topic, as Struts doesn't care what build tools you use; this 
is really a 'how does ant work?' thread.

That said, Sandeep is right, Ant doesn't care where you put your files. 
It's up to you to tell Ant what to do and where to find things. If you 
want to just re-use an existing build.xml the yes, you'll need to put 
your files in the same directory format as it is written to expect.

The easiest thing to do to get started might be to use the 
struts-blank.war that comes with the Struts distribution. Unpack that, 
and you'll have everything set up and ready to go.

More about Ant:
http://ant.apache.org/

L.

Sandeep Gupta wrote:
> Rick,
> 
> You can manually configure all the directorires from where ANT should pick
> up the source and resource files from. They need not be in any specific
> format. But as the directory structure of WAR is fixed you will then 
> have to
> manually code in Ant Script to build the WAR (in the format specified) from
> the compiled files.
> This means you can have
> 1. build.xml in say c:\buildScript
> 2. source files in d:\source1 and e:\source2
> 3. resources in f:\resources
> 4. and you can create a WAR in g:\WAR
> 
> Hope this helps
> 
> Regards,
> 
> Sandeep Gupta
> 
> 
> 
> On 10/11/06, Rick Schumeyer <rs...@ieee.org> wrote:
>>
>> After further contemplation I realized that the mailreader application
>> is in WAR format.  I'm guessing that during development, what is under
>> the ant "build" directory is WAR format.  So the example applications
>> are equivalent to what would be under the "build" directory, plus the
>> java code.  (at least I think this is correct)
>>
>> So if I want to use the example application as a base for development,
>> what is the best advice ?  To manually create the expected ant
>> directories and copy the example files to the correct location?
>>
>> Or is there a blank application already laid out to make ant happy?
>>
>> Rick Schumeyer wrote:
>> > I'm trying to get into the struts game, which means I'm simultaneously
>> > trying to come up to speed on at least three Apache projects: tomcat,
>> > ant, and struts.  Plus servlets and jsps.  I'm sorry if this is a
>> > basic question, but I'm a little flustered.
>> >
>> > Ant seems to expect a certain directory structure under the
>> > build.xml.  I'm not sure if this it *has* to be this way or if the
>> > underlying directory structure is configurable.  As far as I can tell,
>> > ant wants something like:
>> >
>> > ./build.xml
>> > ./build.properties
>> > ./src: (all java files go here, under something like
>> > com.mycompany.whatever )
>> > ./web:
>> > ./web/WEB-INF:
>> >
>> > But the example mailreader application looks like this: (some stuff
>> > ommitted)
>> >
>> > ./WEB-INF:
>> > ./WEB-INF/classes:
>> > ./WEB-INF/classes/*:
>> > ./WEB-INF/entities:
>> > ./WEB-INF/lib:
>> > ./WEB-INF/src:
>> > ./WEB-INF/src/java:
>> > ./WEB-INF/src/java/*:  all java files are here
>> >
>> > So my question is, what am I missing?  Surely ant must be able to
>> > compile the default struts applications, which probably means I need a
>> > different build.xml file.  However, I haven't found any guidance on
>> > this matter by searching the apache site.
>> >
>> > Any help is appreciated!
>> >
>> >
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> > For additional commands, e-mail: user-help@struts.apache.org
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> 
> -- 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: newbie confused by struts and ant

Posted by Sandeep Gupta <sa...@gmail.com>.
Rick,

You can manually configure all the directorires from where ANT should pick
up the source and resource files from. They need not be in any specific
format. But as the directory structure of WAR is fixed you will then have to
manually code in Ant Script to build the WAR (in the format specified) from
the compiled files.
This means you can have
1. build.xml in say c:\buildScript
2. source files in d:\source1 and e:\source2
3. resources in f:\resources
4. and you can create a WAR in g:\WAR

Hope this helps

Regards,

Sandeep Gupta



On 10/11/06, Rick Schumeyer <rs...@ieee.org> wrote:
>
> After further contemplation I realized that the mailreader application
> is in WAR format.  I'm guessing that during development, what is under
> the ant "build" directory is WAR format.  So the example applications
> are equivalent to what would be under the "build" directory, plus the
> java code.  (at least I think this is correct)
>
> So if I want to use the example application as a base for development,
> what is the best advice ?  To manually create the expected ant
> directories and copy the example files to the correct location?
>
> Or is there a blank application already laid out to make ant happy?
>
> Rick Schumeyer wrote:
> > I'm trying to get into the struts game, which means I'm simultaneously
> > trying to come up to speed on at least three Apache projects: tomcat,
> > ant, and struts.  Plus servlets and jsps.  I'm sorry if this is a
> > basic question, but I'm a little flustered.
> >
> > Ant seems to expect a certain directory structure under the
> > build.xml.  I'm not sure if this it *has* to be this way or if the
> > underlying directory structure is configurable.  As far as I can tell,
> > ant wants something like:
> >
> > ./build.xml
> > ./build.properties
> > ./src: (all java files go here, under something like
> > com.mycompany.whatever )
> > ./web:
> > ./web/WEB-INF:
> >
> > But the example mailreader application looks like this: (some stuff
> > ommitted)
> >
> > ./WEB-INF:
> > ./WEB-INF/classes:
> > ./WEB-INF/classes/*:
> > ./WEB-INF/entities:
> > ./WEB-INF/lib:
> > ./WEB-INF/src:
> > ./WEB-INF/src/java:
> > ./WEB-INF/src/java/*:  all java files are here
> >
> > So my question is, what am I missing?  Surely ant must be able to
> > compile the default struts applications, which probably means I need a
> > different build.xml file.  However, I haven't found any guidance on
> > this matter by searching the apache site.
> >
> > Any help is appreciated!
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


--

Re: newbie confused by struts and ant

Posted by Rick Schumeyer <rs...@ieee.org>.
After further contemplation I realized that the mailreader application 
is in WAR format.  I'm guessing that during development, what is under 
the ant "build" directory is WAR format.  So the example applications 
are equivalent to what would be under the "build" directory, plus the 
java code.  (at least I think this is correct)

So if I want to use the example application as a base for development, 
what is the best advice ?  To manually create the expected ant 
directories and copy the example files to the correct location?

Or is there a blank application already laid out to make ant happy?

Rick Schumeyer wrote:
> I'm trying to get into the struts game, which means I'm simultaneously 
> trying to come up to speed on at least three Apache projects: tomcat, 
> ant, and struts.  Plus servlets and jsps.  I'm sorry if this is a 
> basic question, but I'm a little flustered.
>
> Ant seems to expect a certain directory structure under the 
> build.xml.  I'm not sure if this it *has* to be this way or if the 
> underlying directory structure is configurable.  As far as I can tell, 
> ant wants something like:
>
> ./build.xml
> ./build.properties
> ./src: (all java files go here, under something like 
> com.mycompany.whatever )
> ./web:
> ./web/WEB-INF:
>
> But the example mailreader application looks like this: (some stuff 
> ommitted)
>
> ./WEB-INF:
> ./WEB-INF/classes:
> ./WEB-INF/classes/*:
> ./WEB-INF/entities:
> ./WEB-INF/lib:
> ./WEB-INF/src:
> ./WEB-INF/src/java:
> ./WEB-INF/src/java/*:  all java files are here
>
> So my question is, what am I missing?  Surely ant must be able to 
> compile the default struts applications, which probably means I need a 
> different build.xml file.  However, I haven't found any guidance on 
> this matter by searching the apache site.
>
> Any help is appreciated!
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org