struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: Struts2 with AngularJS
Date Thu, 20 Nov 2014 09:16:22 GMT
2014-11-19 11:20 GMT+01:00 foo bar <linutrix@gmail.com>:
> Hi,
>
> Thanks for the prompt reply, I'll have a look at the Struts2 AngularJS
> archetype
> But I meant AngularJS interceptor (
> https://docs.angularjs.org/api/ng/service/$http) which is still client
> side, AngularJS interceptor is meant to intercept {name:"abc",address:"abc"}
> and change it to {customer:{name:"abc",address:"abc"}}
>
> I'm looking at the source code for the REST plugin, looks like the magic
> happens in ContentTypeInterceptor, this gets the payload from http
> inputstream then maps it to the action. If I want to use
> {name:"abc",address:"abc"},
> looks like I have to use @ModelDriven ?

Yes if you want to expose customer entity and not action's properties
(name and address)

> Is it fine to just use REST plugin's ContentTypeInterceptor and the
> JsonLibHandler and include them in my web application ?
> i.e. are they fairly standalone-ish ? or do they have dependencies with
> other components in the REST plugin ?

Maybe JSON plugin is all you need? Then action can simply return and
accept JSON (there is an interceptor that do all the magic)


Regards
-- 
Ɓukasz
+ 48 606 323 122 http://www.lenart.org.pl/

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


Mime
View raw message