Hi Thierry,
thanks for the quick reply.
Overriding the ServerResource#doInit method solved the problem for the
getRequest().getResourceRef() method, but not for the getRootRef()
method. Here I still get a NullPointerException.
String root =
getRequest().getResourceRef().getParentRef().getIdentifier();
is correct in some situations but it depends on the place in the
hierarchy...
Best regards,
Tobias
On Mon, 2010-02-01 at 12:54 +0100, Thierry Boileau wrote:
> Hi Tobias,
>
> could you override the ServerResource#doInit method instead of the
> constructor?
>
> Best regards,
> Thierry Boileau
>
>
> > Hi Jerome,
> >
> > I started to migrate to 2.0m7 now and I have an issue:
> > If I call the getRequest().getRootRef().getIdentifier() method in the
> > constructor of my Resource I get a java.lang.NullPointerException.
> > My Resource extends the ServerResource class and that's what I do:
> >
> > public AlgorithmResource() {
> > super();
> > System.out.println("TEST: " +getRequest().getRootRef().getIdentifier());
> > }
> >
> > @Get("html")
> > public Representation toHtml(){
> > ... some code ...
> > }
> >
> > Has the way to get the root (or resource) uri changed from 1.1 to 2.0?
> >
> > Best Regards
> > Tobias
> >
> > On Tue, 2010-01-05 at 22:29 +0000, Jerome Louvel wrote:
> >
> > > Hi Tobias,
> > >
> > > We haven't fully documented the migration guide yet. We will work on
> > > that after our 2.0 RC1 release due this month. For now, here is the
> > > early draft version available:
> > > http://wiki.restlet.org/docs_2.0/13-restlet/171-restlet/155-restlet.html
> > >
> > > Please, let us know if you have any issue.
> > >
> > > Best regards,
> > > Jerome Louvel
> > > --
> > > Restlet ~ Founder and Lead developer ~ http://www.restlet.org
> > > Noelios Technologies ~ Co-founder ~ http://www.noelios.com
> > >
> > >
> > > 2010/1/4 <[email protected]>
> > >
> > > > Hello,
> > > >
> > > > I see that the restlet framework in version 2.0m6 has certainly more
> > > > and better features than the old 1.1 version I am using. I wonder how
> > > > difficult it is, to migrate to restlet 2.0 as it seems some API changes
> > > > have taken place?
> > > >
> > > > best regards
> > > > Tobias
> > > >
> > > > ------------------------------------------------------
> > > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2434634
> > > >
> > > ------------------------------------------------------
> > > http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2435029
> > >
> >
> >
--
Dipl.-Bioinf. Tobias Girschick
Technische Universität München
Institut für Informatik
Lehrstuhl I12 - Bioinformatik
Bolzmannstr. 3
85748 Garching b. München, Germany
Room: MI 01.09.042
Phone: +49 (89) 289-18002
Email: [email protected]
Web: http://wwwkramer.in.tum.de/girschick
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2443779