Restlet ServerResource registerNumber method

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Restlet ServerResource registerNumber method

Victor Yeo
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();

    }

}





--
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 [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Restlet ServerResource registerNumber method

Tim Peierls
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

On Sat, Nov 11, 2017 at 8:24 PM, Victor Yeo <[hidden email]> wrote:
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();

    }

}





--
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 [hidden email].

--
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 [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Restlet ServerResource registerNumber method

Victor Yeo
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. 

The modern way for processing HTTP Post, do we use post as in https://restlet.com/open-source/documentation/javadocs/2.3/jee/api/org/restlet/resource/ServerResource.html#post(org.restlet.representation.Representation) ?

On Sunday, November 12, 2017 at 9:34:23 AM UTC+8, tim wrote:
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

On Sat, Nov 11, 2017 at 8:24 PM, Victor Yeo <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="5Prwl8l4BQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">yeosi...@...> wrote:
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();

    }

}





--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="5Prwl8l4BQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">framework-disc...@restlet.org.

--
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 [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Restlet ServerResource registerNumber method

Tim Peierls
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

On Sat, Nov 11, 2017 at 9:36 PM, Victor Yeo <[hidden email]> wrote:
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. 

The modern way for processing HTTP Post, do we use post as in https://restlet.com/open-source/documentation/javadocs/2.3/jee/api/org/restlet/resource/ServerResource.html#post(org.restlet.representation.Representation) ?

On Sunday, November 12, 2017 at 9:34:23 AM UTC+8, tim wrote:
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

On Sat, Nov 11, 2017 at 8:24 PM, Victor Yeo <[hidden email]> wrote:
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();

    }

}





--
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 [hidden email].

--
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 [hidden email].

--
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 [hidden email].
Reply | Threaded
Open this post in threaded view
|

Re: Restlet ServerResource registerNumber method

Victor Yeo
ok. Thank you.

On Sun, Nov 12, 2017 at 10:59 AM, Tim Peierls <[hidden email]> wrote:
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

On Sat, Nov 11, 2017 at 9:36 PM, Victor Yeo <[hidden email]> wrote:
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. 

The modern way for processing HTTP Post, do we use post as in https://restlet.com/open-source/documentation/javadocs/2.3/jee/api/org/restlet/resource/ServerResource.html#post(org.restlet.representation.Representation) ?

On Sunday, November 12, 2017 at 9:34:23 AM UTC+8, tim wrote:
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

On Sat, Nov 11, 2017 at 8:24 PM, Victor Yeo <[hidden email]> wrote:
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();

    }

}





--
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 [hidden email].

--
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 [hidden email].


--
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 [hidden email].