Struts 2
Struts 2.0.6 (the first general availability release) has been out a month (but I’ve only just noticed). I’ve tried a HelloWorld app and after some difficulties got it running.
The difficulties were all my own fault - I kept getting the following messages: “There is no Action mapped for action name HelloWorld.” or “There is no Action mapped for namespace / and action name HelloWorld.”. They were resolved when I realised my struts.xml was in the wrong folder - by default this should be in the root of classes and I had it in the root of WEB-INF.
March 21st, 2007 at 1:07 pm
Yarr! Struts2 be a thing of much beauty (compared to the sea-hag that is our Struts usage at work ;))
Did you try using the maven archetype when getting the helloworld example running? Tiz a good example of how much easier Maven can make things
See http://struts.apache.org/2.x/docs/ready-set-go.html
March 21st, 2007 at 1:13 pm
Agreed Struts 2 looks a lot better than the “interesting” variant we use.
I couldn’t get the maven integration working right in netbeans - I guess I need to load struts 2 into the maven repository, I guess that ought to be my next step.
March 21st, 2007 at 5:25 pm
? Hmm… it should download the struts2 libraries when you create the project from the archetype, using their custom repo (http://people.apache.org/repo/m2-snapshot-repository)
But yeah, the Netbeans plugin for Maven did seem a bit strange when I tried it. Try the following (assuming you’ve installed Maven and it’s in your PATH):
1. Create the project: mvn archetype:create -DgroupId=tutorial -DartifactId=tutorial -DarchetypeGroupId=org.apache.struts -DarchetypeArtifactId=struts2-archetype-starter -DarchetypeVersion=2.0.5-SNAPSHOT -DremoteRepositories=http://people.apache.org/repo/m2-snapshot-repository
2. Change to the newly-created “tutorial” directory and type: mvn netbeans-freeform:generate-netbeans-project (from http://maven.apache.org/guides/mini/guide-ide-netbeans/guide-ide-netbeans.html)
This should create a directory for the netbeans project file and all that “extra stuff” netbeans uses.
Or, if you have an evaluation copy of IntelliJ, try “mvn idea:idea”
All the dependent libraries (i.e. struts2, etc.) should be downloaded to your local repository when you create the netbeans project (well, they were when I created the IDEA ones)…
March 21st, 2007 at 5:26 pm
? think my previous comment was swallowed by spam filter…!
March 22nd, 2007 at 9:41 am
rescued it - akismet normally does a good job, although with most of the comments I get being spam
it hasn’t had much non-spam to process.
Hopefully, I’ll give the Maven stuff a whirl later.
March 23rd, 2007 at 12:50 am
[...] Gaz’s help I’ve setup a basic Struts 2 project using Maven and NetBeans - I seem to have lost the [...]