开发者

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.:

  • sample.com/samepath/resource_rep.html

    should map to JSF2 (get, post) - (note pretty URL)

  • sample.com/samepath/resource_rep.xml

    should map to REST xml resource representation (get,post,put,delete)

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".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜