Using Struts 2.1.2 and json-plugin 0.30.

I've been having issues configuring the json-plugin while using the
@Result annotations.

@Action(name = "items-json")
@Results({
    @Result(name = ListItemsJsonAction.SUCCESS, type =
JSONResult.class, value = "",
    params = { "root", "newsItems" } )
})
public class ListItemsJsonAction extends ListItemsAction
{
}

The code above results in a OGNException:
ognl.NoSuchPropertyException:
com.googlecode.jsonplugin.JSONResult.location

The obvious thing to do would be to remove the value = "" from the
@Result annotation, but this in turn results in an:
java.lang.annotation.IncompleteAnnotationException:
org.apache.struts2.config.Result missing element value


It looks as though its impossible to configure a json-plugin with annotations?
Annotations only appear to work where the Result type has a property
called "location" - inheriting from StrutsResultSupport provides this
(and as such, I haven't had any issue with my custom Result types that
I've written).

This appears to be a bug? For now, the way around this is to use XML
configuration for this particular action and result.


Alex

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to