This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
Here are two things I've been trying to understand, but the lack of working documentation is blocking me:
a) configuring the url action suffix (ie removing/changing .action) -- Ian Roughley's on-line book alludes to this being possible by editing the struts.properties file (or any of the other ways of setting "Constant Configuration" parameters, but there is no list of the name of the property and/or discussion. The wiki is broken, and the reference to looking inside struts2.jar doesn't seem to work as there isn't a file by the name struts-default.properties inside the jar...
b) playing with "Zero Configuration" aka auto-detection of Action classes and Result Annotations -- both the various guides and Roughley's book reference the ability to move some of the xml configuration into the Action class via annotations. However in all my attempts I end up with a "There is no Action mapped..." error message. When I convert back to an explicitly xml-mapped action everything works, so I know I have a working base system. When I add the actionPackages parameter to the filter, I can see an info message emitted in the console that shows it looking in the correct place. I've tried using either/both of the Action suffix on the class or the implements Action tag for the autodetection. I've tried with and without the full suite of Namespace,ParentPacakge,Results,Result annotations or with soley a Result one.
Obvisouly I'm missing something, but I can't seem to find resources on struts 2 on-line. And aside from Roughley's book, all the stuts 2 books are not yet printing it appears.
Has anyone found useful/functioning Struts 2 references?
Thanks [ August 24, 2007: Message edited by: Eric Nielsen ]
Eric , try to call your action by putting the first char in lowercase. I had the same problem, and the docs seems not to mention that clearly (I hate that).
So if you have InsertItemAction.java, your action name will be insertItem.action
Joined: Dec 14, 2004
Yes, I had found, over the weekend, that the capitalization was the problem with switch to the annotation based configuration. I "knew" that was the normal standard for struts 1 applications, but wasn't getting it to work properly with the xml based configuration (probably a non-related issue), but after tweaking a lot of things ended up with it working when capitalized... When I switched to the annotation based system, I didn't think to change it back, until I installed the config-browser which showed the name of the configured action.
I'm still wondering if anyone knows what's going on with the struts 2 wiki and why so much of it generates errors.