It's funny that you happened to ask this tonight, I am working on a JSON
result with annotations as I am writing this...

First off, are you using a plugin to provide the annotations? If so,
which one. I am using struts-2.1.3-snapshot (which might make a
difference) in conjunction with the conventions plugin.

I have an action with the following annotation and it is working fine
for me - 

@Action([EMAIL PROTECTED](name="success",type="json")})



On Sun, 2008-10-12 at 05:02 +0200, Alex Coles wrote:
> 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]
> 


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

Reply via email to