Ryan,
I just went through a similar learning process. I found that by
following the model of the online tutorial, I had a lot more luck
getting started than trying to start from scratch.
Load up the WTP plugins for Eclipse, grab the "quickstart" zip file
mentioned in the online tutorial, and use that as your starting point.
Everything will already be laid out where it needs to be. You begin to
understand why and how as you start adding your own functionality to the
project. It really is a good learning tool.
As for the Maven commands, you could use "mvn war:war" to build your WAR
file. I often use "mvn install" because it builds, runs unit tests,
packages, and installs the artifact in your repository. There are
easily a dozen different ways to use Maven to build at various levels.
As for hibernate mappings, just don't. I've found that the JPA
annotations are cleaner and, in my opinion, easier! The tutorial covers
those a bit, but the more advanced annotations are not difficult to
catch on to.
Good luck!
Dave
Ryan Detert wrote:
I just read the Manning book on Struts 2 and understand the theory behind
Struts but am a little bit confused as to how to actually implement my first
app in practice. The locations of the config files, etc are a little
confusing.
For my development environment I'm using Maven 2 + Ecplise IDE. I'm not
compiling in Eclipse at all, I want to package and everything using Maven
for compatibility purposes.
I have already read this tutorial:
http://struts.apache.org/2.0.11.2/docs/struts-2-spring-2-jpa-ajax.html
as well as the sample app in Manning's book. The files are relatively
similar but always placed in different locations.
For my first app, all I want to do is create a form and have the submitted
values placed in a database table. Simple.
For my current webapp, I have used a command like this I've had to add a few
modules like hibernate to the pom.xml:
mvn archetype:create -DgroupId=tutorial \
-DartifactId=tutorial \
-DarchetypeGroupId=org.apache.struts \
-DarchetypeArtifactId=struts2-archetype-starter \
-DarchetypeVersion=2.0.3-SNAPSHOT \
-DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository
How do I compile the webapp? I have been using 'mvn package' but it never
seems to generate any errors.
I have used the Ecplise plugin to reverse engineer the database I've built
and each class comes with an *.hbm.xml file, do I need to worry about these?
How do I know where to put config files like applicationContext.xml, every
sample app I look at they seem to be in a different place?
If anyone could login to my system that would be great, it would probably
take anyone who knew what they were doing a very short amount of time.
-thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]