users@jersey.java.net

Re: [Jersey] Jersey explicit MVC

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Wed, 29 Apr 2009 08:34:38 +0200

On Apr 28, 2009, at 6:29 PM, Nabil Benothman wrote:

> Hi,
> I'm using the default lib integrated in netbeans. may be it's not the
> latest version so witch version do i need?
>


The latest is 1.0.3 (and you will need to install the jars into your
NB ap yourself).

The the behavior for 1.0 and 1.0.3 for the views functionality you are
using should be the same though. Namely it should find an "index.jsf"
if present in the correct location.

I really do need more information to help you resolve the issue, like
the directory layout of the web pages, or even better a complete
project that reproduces your issue (send it to me privately if you
like).

Paul.

>
> thanks for help
>
>
> Le 28/04/2009 à 6:03 م, Paul Sandoz (via Nabble) a écrit :
>
> > On Apr 28, 2009, at 5:37 PM, Nabil Benothman wrote:
> >
> > >
> > > Hi,
> > > thanks for your answer but where the « JSPTemplateProcessor » is
> > > called,
> >
> > The answer is a little involved... there is a message body writer
> that
> > is responsible for processing instances of Viewable, that defers to
> > the registered template processors to resolve an absolute template
> > name into a fully qualified template name.
> >
> > If say you have a resource class FooResource:
> >
> > package foo;
> >
> > public class FooResource {
> > @GET
> > public Viewable get() {
> > return new Viewable("index.jsf, "MODEL");
> > }
> > }
> >
> >
> > then because the template name "index.jsf" is not absolute it will
> be
> > resolved to an absolute template name given the FooResource:
> >
> > index.jsf -> /foo/FooResource/index.jsf
> >
> > Then the template processors will be check to see if they can
> resolve
> > the absolute template name to a fully qualified template name.
> >
> > Specifically for the JSPTemplateProcessor it will be resolved if:
> >
> > servletContext.getResource("/foo/FooResource/index.jsf")
> >
> > returns a non-null value. Namely, there exists a file "/foo/
> > FooResource/index.jsf" in the web pages area.
> >
> > If that file exists then Jersey will forward the servlet request to
> > that resource.
> >
> >
> > > do
> > > I need some additional configuration like adding some settings in
> > the
> > > web.xml, etc..?
> >
> > No, for explicit returning of Viewable instances as you are doing,
> the
> > JSP viewable support will be enabled because you are using the
> Jersey
> > servlet.
> >
> >
> > > and I think that the class « HttpResponseAdaptor » does not
> > > exist in the jsr311-api implementation.
> > >
> >
> > Hmm... what version of Jersey are you using?
> >
> > Can you send me the directory layout of your project, specifically
> the
> > files in the Web pages area?
> >
> > Paul.
> >
> --
> Benothman Nabil
> nabil.benothman@...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Archive.zip (253K) Download Attachment
>
> View this message in context: Re: [Jersey] Jersey explicit MVC
> Sent from the Jersey mailing list archive at Nabble.com.