struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Salvatore Lionetti <salvatore.lione...@youco.eu>
Subject Re: @SMD annotation
Date Thu, 20 Sep 2012 07:06:22 GMT
Hi Frans,

Thanks for your suggestion, really interesting
"Built-in resource transformer for JSON and XML."

But struts-json plugin seems to provide all the "tools" in my case.
I see the code changed a lot, expecially now the annotation on SMD
object is now done in SMDGenerator::generate() instead of
JSONResult::writeSMD, Perhaps i've a problem with the root object. But
in my case there are many SMD methods, each resembling to a particular
bean automagically serialized/deserialized by the plugin. Moreover the
strange thing is that method are correctly collected from my custom
object. Does the initial message (method: [] , ..., objectName, ... )
is generated in SMDGenerator::generate()?

Thanks for your attention



2012/9/20, Frans Thamura <frans@meruvian.org>:
> hi there,,
>
> we modify the REST, i believe you interest with @SMD because want to
> process the response
>
> try this
>
> s2restplugins.java.net
>
> F
>
> On Thu, Sep 20, 2012 at 2:18 AM, Salvatore Lionetti
> <salvatorelionetti@gmail.com> wrote:
>> Hi,
>>
>> i'm using a beautiful Struts2 2.3.1.2 environment.
>> I'm having trouble with annotation @SMD, basically ignored, at least
>> in the initial message:
>>
>> methods: [...], "objectName": null, ... "version": .1 (the default)
>>
>> This is the commands:
>>
>> Java
>> @SMD(objectName = "TEST", serviceType = "JSON-RPC", version = "10.0")
>> public class SimpleJAction {
>>     public String smd()
>>     {
>>         return Action.SUCCESS;
>>     }
>>     @SMDMethod
>>     ... a lot of methods.
>> }
>>
>> Struts.xml
>>     <package name="example" extends="json-default">
>>         <action name="simpleJAction" class="x.y.SimpleJsonAction"
>> method="smd">
>>             <interceptor-ref name="json">
>>                 <param name="enableSMD">true</param>
>>                 <param name="ignoreSMDMethodInterfaces">false</param>
>>             </interceptor-ref>
>>             <result type="json">
>>                 <param name="enableSMD">true</param>
>>                 <param name="contentType">text/html</param>
>>                 <param name="ignoreInterfaces">false</param>
>>             </result>
>>         </action>
>>       ...
>>      </package>
>>
>> Basically all works great, except @SMD annotation is totally ignored
>> (compile support seem works great!)
>>
>> In the first method called in class SimpleJsonAction, the second
>> message exchanged after the 'methods' one, i dump:
>>
>> log.error(this.getClass().getAnnotation(SMD.class).toString());
>>
>> And obtain an almost  correct (serviceType is no more 'JSON-RPC', anyway)
>>
>> @org.apache.struts2.json.annotations.SMD(serviceType=service,
>> version=10.0,...)
>>
>> Could you please help me in finding the mistake?
>>
>> Thanks for your attention
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message