Hi guys,
Great to be joining the mailing list.
I have been experimenting with Jersey for the past couple of weeks, and
would like to share a challenge I am facing.
I am looking to build a Spring based application with both human web and
machine web clients. I want to be able to, as far as possible, serve HTML
pages as well as JSON (or some other machine friendly representation) out of
the same codebase.
REST looks like a good fit for this because the the same Resource could
simply have different Representations for humans and machines.
Jersey looks like a good fit because there are already examples that
demonstrate the implicit binding of JSP views to Resources (Bookstore
sample), and the annotated Spring integration (spring-annotations sample).
The trouble for me is, I havent so far managed to get both concepts working
at the same time in the same application. I have tried various ways of
combining the two samples, but I always end up with a 404 when accessing the
Resource URLS from the web browser. Im guessing I just need to strike upon
the right way of configuring web.xml, but the two samples take two different
approaches here. Bookstore sets up Jersey using a filter, and
Annotated-Spring uses a Servlet. I have tried taking the configuration
options used against the filter in Bookstore and adding them to the
servlet's configuration in Annotated-Spring, but no joy.
Is it clear what I am trying to do? If so, is it possible with the current
version of Jersey?
Any help would be much appreciated!
Thanks,
Ross