users@jersey.java.net

Re: [Jersey] Jersey explicit MVC

From: Casper Bang <casper.bang_at_gmail.com>
Date: Tue, 28 Apr 2009 11:05:17 +0200

Hi Nabil,

Have you tried supplementing Jersey's default JSP handler with a JSF
handler? Poul writes about that here, the impl snippet looks pretty
simple: http://blogs.sun.com/sandoz/entry/mvcj

Regards,
Casper




Nabil Benothman wrote:
> Hello everyone,
> I am starting with the framework jersey and I have a little problem with the
> explicit MVC. To use facelets (. xhtml), I had to go through a jsp in which
> I forward to the JSF. So my question is: « is there another alternative to
> do so without having to go through the jsp » ie instead of returning « new
> Viewable (" index.jsp ", entity);» we return directly «new Viewable ("
> index.jsf ", entity)».
> the code is as follows :
>
> // resource
> ....
> @GET
> @Produces(MediaType.TEXT_HTML)
> public Viewable get() {
> EntityManager em =
> PersistenceService.getInstance().getEntityManager();
>
> Collection<UbikeUser> users = (Collection<UbikeUser>)
> em.createNamedQuery(
> "user.getAll").getResultList();
>
> return new Viewable("/usersInfo.jsp", users);
> }
> ....
>
> // JSP
> ....
> <jsp:forward page="usersInfo.jsf"/>
> ....
>
>
>
>
>
>
> Thank you for your help.
>