Support breaking the view layer from the control layer
(Email from Guilherme Silveira, http://java.net/projects/jax-rs-spec/lists/jsr339-experts/archive/2011-03/message/90 )
4. Also support breaking the view layer from the control layer
If a method does not serialize or return anything, assume a default behavior so you don't have to repeat yourself all over the place. For example, if the show method did not return anything it would go to "/software/show.jsp" or /software/show.json.jsp or /software/show.xml.jsp etc according to conneg. To implement it, the semantic model needs to be exposed again:
public interface PathResolver { String pathFor(ResourceMethod method); }
Affected Versions
[2.0]
- Issue Imported From: https://github.com/jax-rs/api/issues/70
- Original Issue Raised By:@glassfishrobot
- Original Issue Assigned To: @glassfishrobot
@glassfishrobot Commented Reported by robc
@glassfishrobot Commented @mpotociar said: Out of scope for 2.0. Assigning to the right category and deferring to a future release.
@glassfishrobot Commented This issue was imported from java.net JIRA JAX_RS_SPEC-65
Is there a plan to publish Jersey's Viewable, e.g. under jakarta.ws.rs.ext?
We are developing a code generator that allows using different JAX-RS frameworks and we were was planning to replace RequestDispatcher.forward() method calls with Response.ok(new Viewable()) only to find this will only work in Jersey.
Thanks in advance and hope I am replying to the relevant issue.
No, there isn't such a plan.
But you should have a look at JSR 371, which is an action-oriented web framework built on top of JAX-RS. The corresponding specification will go final in the next few weeks and is heavily inspired by Jersey's Viewable.
https://www.mvc-spec.org/