Restlet ServerResource registerNumber method

3 views
Skip to first unread message

Victor Yeo

unread,
Nov 11, 2017, 8:24:08 PM11/11/17
to Restlet Framework (Discuss)
Hi,

I used Restlet back in 2015. This week i am looking at Restlet again. I have a code as below. I could not find registerNumber in the restlet javadoc. what happened?

public class whatisme extends ServerResource {

    public Representation registerNumber(Representation entity) {

    

        String postContent=null;


        

        Form form = new Form(entity);  

        String queryStr = form.getQueryString();

        System.out.println("queryStr : "+ queryStr);

        String sUserid= form.getFirstValue("userid","").trim(); 

...

        return getResponseEntity();

    }

}





Tim Peierls

unread,
Nov 11, 2017, 8:34:23 PM11/11/17
to Victor Yeo, Restlet Framework (Discuss)
The modern way to write a Restlet ServerResource implementation is to use annotations (@Get, @Post, @Put, or @Delete) on the Java methods corresponding to the GET, POST, PUT, and DELETE HTTP methods.

If you don't use annotations, you need to use a method name corresponding to the HTTP method. It's all there in the Restlet docs.

--tim

--
You received this message because you are subscribed to the Google Groups "Restlet Framework (Discuss)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe@restlet.org.

Victor Yeo

unread,
Nov 11, 2017, 9:36:02 PM11/11/17
to Restlet Framework (Discuss), yeosi...@gmail.com
Thanks, i check the restlet docs, https://restlet.com/open-source/documentation/javadocs/2.3/jee/api/

i do not see the registerNumber method. I guess it is obsolete. 

To unsubscribe from this group and stop receiving emails from it, send an email to framework-disc...@restlet.org.

Tim Peierls

unread,
Nov 11, 2017, 9:59:59 PM11/11/17
to Victor Yeo, Restlet Framework (Discuss)
No. You use the annotations so you don't have to rely on a method name convention.

It sounds like you haven't seen enough examples. Search for tutorials.

--tim

To unsubscribe from this group and stop receiving emails from it, send an email to framework-discuss+unsubscribe@restlet.org.

Victor Yeo

unread,
Nov 14, 2017, 8:15:43 AM11/14/17
to Restlet Framework (Discuss)
ok. Thank you.
Reply all
Reply to author
Forward
0 new messages