wood burning stoves
The moose likes Struts and the fly likes Struts 2 -- on-line resources? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2 -- on-line resources?" Watch "Struts 2 -- on-line resources?" New topic

Struts 2 -- on-line resources?

Eric Nielsen
Ranch Hand

Joined: Dec 14, 2004
Posts: 194
I'm trying to get started evaluating Struts 2, but I'm finding it rather slow going since the struts 2 wiki seems to be rather broken (for at least the past 48 hours).

Many pages yield a "An error occured: Connection refused. The system administrator has been notified". (e.g. http://struts.apache.org/2.x/docs/strutsproperties.html )

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?

[ August 24, 2007: Message edited by: Eric Nielsen ]
Luciano Domenico

Joined: Aug 27, 2007
Posts: 1
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

Eric Nielsen
Ranch Hand

Joined: Dec 14, 2004
Posts: 194
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.
I agree. Here's the link: http://aspose.com/file-tools
subject: Struts 2 -- on-line resources?
It's not a secret anymore!