Hi
On 03/02/12 18:13, KARR, DAVID wrote:
-----Original Message-----
From: Guy Pardon [mailto:g...@atomikos.com]
Sent: Friday, February 03, 2012 9:54 AM
To: users@cxf.apache.org
Subject: REST and MVC for webapps
Hi,
I am looking for examples and/or information on using CXF/REST/JAXRS as
the controller for html webapps - instead of Struts or JSF.
Any pointers available?
Just a high-level comment on the approach:
If you're building a "conventional" web site where you move from page to page, a REST
service would likely only represent a portion of your application. You'd still want to have a
"conventional" web framework like Spring MVC, Struts, or JSF (which provides some
additional paradigms).
If, however, you're building a "single-page web application" where server
communication is primarily done through AJAX calls from a Javascript framework like Dojo
or others, then a REST service might become more prominent.
The point is that a REST service handles a certain kind of interaction pattern,
and page to page navigation doesn't quite fit that.
FYI, the jaxrs_oauth demo (the complete 3 leg flow) which we are working
upon and to be packaged in the Talend ESB 5.0.2 relies entirely on this
feature:
http://cxf.apache.org/docs/jax-rs-redirection.html
(RequestDispatcher provider)
for supporting the navigation from one page to another page. I think we
have 7 or so JSP pages there. It's all very light, simple but effective,
The provider simply redirects the data to the chosen view engine (JSP or
whatever). The JAX-RS resource code just looks as usual, returns some
custom bean, and if HTML is expected back then RequestDispatcher will
add this data to HttpServketRequest & redirect.
I'm going to highlight it more over the coming weeks.
The "oauth" demo Lukash Moren did and which is included in the
release/samples uses Spring MVC.
I'd like though to create a dedicated demo showing the integration
between Spring MVC & CXF, using the custom redirection feature, it;s on
the map but is not prioritized
Cheers, Sergey
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com