Mapping REST endpoint and JSF2 view on same URI
The goal is to combine a REST based web interface with JSF2 GUI interface in such a way so that the URI path' to correspondig resourc开发者_JAVA百科e representations remain the same, i.e.:
should map to JSF2 (get, post) - (note pretty URL)sample.com/samepath/resource_rep.html
should map to REST xml resource representation (get,post,put,delete)sample.com/samepath/resource_rep.xml
Both identifiers, JSF2 resource_rep.html
and REST resource_rep.xml
would logically represent the same resource in different ways - once for human interaction (JSF2) and once for machine interaction (REST).
JSF2 + JAX-RS (Java EE 6) or JSF2 with SPRING (V3) are the two available choices for me. Is such a thing possible and if yes, how can it be done?
Thanks for any ideas
Map JSF on *.html
and map JAX-RS on *.xml
.
Please note that having *.xml
extension is not really "RESTful".
精彩评论