[JIRA] Created: (STS-774) Resolve event handler by HTTP verb (RestBinding)

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

[JIRA] Created: (STS-774) Resolve event handler by HTTP verb (RestBinding)

JIRA jira@stripesframework.org
Resolve event handler by HTTP verb (RestBinding)
------------------------------------------------

                 Key: STS-774
                 URL: http://www.stripesframework.org/jira/browse/STS-774
             Project: Stripes
          Issue Type: New Feature
            Reporter: Evan Leonard
         Attachments: RestBinding_annotation.patch

Attached is a patch that enables one to bind a rest verb to a specific handler in your ActionBean. An example:


@UrlBinding("/RestAction")
public class RestActionBean implements ActionBean {

  @RestBinding("PUT")
   public Resolution myPutHandler() {
       log.info("Got a Put");
       return null;
   }
}

Now if you send a PUT request to "/yourapp/RestAction", it will be routed to the "myPutHandler" method.

The patch needs a little review & clean-up before committing. Ben's had at least a quick look at it at this point.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Updated: (STS-774) Resolve event handler by HTTP verb (RestBinding)

JIRA jira@stripesframework.org

     [ http://www.stripesframework.org/jira/browse/STS-774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Evan Leonard updated STS-774:
-----------------------------

    Attachment: RestBinding_annotation.patch

> Resolve event handler by HTTP verb (RestBinding)
> ------------------------------------------------
>
>                 Key: STS-774
>                 URL: http://www.stripesframework.org/jira/browse/STS-774
>             Project: Stripes
>          Issue Type: New Feature
>            Reporter: Evan Leonard
>         Attachments: RestBinding_annotation.patch
>
>
> Attached is a patch that enables one to bind a rest verb to a specific handler in your ActionBean. An example:
> @UrlBinding("/RestAction")
> public class RestActionBean implements ActionBean {
>   @RestBinding("PUT")
>    public Resolution myPutHandler() {
>        log.info("Got a Put");
>        return null;
>    }
> }
> Now if you send a PUT request to "/yourapp/RestAction", it will be routed to the "myPutHandler" method.
> The patch needs a little review & clean-up before committing. Ben's had at least a quick look at it at this point.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Updated: (STS-774) Resolve event handler by HTTP verb (RestBinding)

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

     [ http://www.stripesframework.org/jira/browse/STS-774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Gunter updated STS-774:
---------------------------

    Fix Version/s: Release 1.5.5

> Resolve event handler by HTTP verb (RestBinding)
> ------------------------------------------------
>
>                 Key: STS-774
>                 URL: http://www.stripesframework.org/jira/browse/STS-774
>             Project: Stripes
>          Issue Type: New Feature
>            Reporter: Evan Leonard
>             Fix For: Release 1.5.5
>
>         Attachments: RestBinding_annotation.patch
>
>
> Attached is a patch that enables one to bind a rest verb to a specific handler in your ActionBean. An example:
> @UrlBinding("/RestAction")
> public class RestActionBean implements ActionBean {
>   @RestBinding("PUT")
>    public Resolution myPutHandler() {
>        log.info("Got a Put");
>        return null;
>    }
> }
> Now if you send a PUT request to "/yourapp/RestAction", it will be routed to the "myPutHandler" method.
> The patch needs a little review & clean-up before committing. Ben's had at least a quick look at it at this point.

--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://www.stripesframework.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (STS-774) Resolve event handler by HTTP verb (RestBinding)

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

    [ http://www.stripesframework.org/jira/browse/STS-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12153#comment-12153 ]

Janne Jalkanen commented on STS-774:
------------------------------------

The list of allowed REST verbs is a bit restrictive: you can't e.g. implement HEAD. Neither could you use this to implement a WebDAV server, since it introduces several new HTTP verbs.  I'm not even sure why there should be a check for the allowed verb in the first place, since if the binding is not found, it's an error anyway.

Speaking of errors, I think the code should return a 400 or 405 if there's a bad HTTP verb.

> Resolve event handler by HTTP verb (RestBinding)
> ------------------------------------------------
>
>                 Key: STS-774
>                 URL: http://www.stripesframework.org/jira/browse/STS-774
>             Project: Stripes
>          Issue Type: New Feature
>            Reporter: Evan Leonard
>             Fix For: Release 1.5.5
>
>         Attachments: RestBinding_annotation.patch
>
>
> Attached is a patch that enables one to bind a rest verb to a specific handler in your ActionBean. An example:
> @UrlBinding("/RestAction")
> public class RestActionBean implements ActionBean {
>   @RestBinding("PUT")
>    public Resolution myPutHandler() {
>        log.info("Got a Put");
>        return null;
>    }
> }
> Now if you send a PUT request to "/yourapp/RestAction", it will be routed to the "myPutHandler" method.
> The patch needs a little review & clean-up before committing. Ben's had at least a quick look at it at this point.

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (STS-774) Resolve event handler by HTTP verb (RestBinding)

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

    [ http://www.stripesframework.org/jira/browse/STS-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12154#comment-12154 ]

Janne Jalkanen commented on STS-774:
------------------------------------

Oops, sorry, 501 Not Implemented is probably the correct response code.

> Resolve event handler by HTTP verb (RestBinding)
> ------------------------------------------------
>
>                 Key: STS-774
>                 URL: http://www.stripesframework.org/jira/browse/STS-774
>             Project: Stripes
>          Issue Type: New Feature
>            Reporter: Evan Leonard
>             Fix For: Release 1.5.5
>
>         Attachments: RestBinding_annotation.patch
>
>
> Attached is a patch that enables one to bind a rest verb to a specific handler in your ActionBean. An example:
> @UrlBinding("/RestAction")
> public class RestActionBean implements ActionBean {
>   @RestBinding("PUT")
>    public Resolution myPutHandler() {
>        log.info("Got a Put");
>        return null;
>    }
> }
> Now if you send a PUT request to "/yourapp/RestAction", it will be routed to the "myPutHandler" method.
> The patch needs a little review & clean-up before committing. Ben's had at least a quick look at it at this point.

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Updated: (STS-774) Resolve event handler by HTTP verb (RestBinding)

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

     [ http://www.stripesframework.org/jira/browse/STS-774?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ben Gunter updated STS-774:
---------------------------

    Fix Version/s:     (was: Release 1.5.5)

> Resolve event handler by HTTP verb (RestBinding)
> ------------------------------------------------
>
>                 Key: STS-774
>                 URL: http://www.stripesframework.org/jira/browse/STS-774
>             Project: Stripes
>          Issue Type: New Feature
>            Reporter: Evan Leonard
>         Attachments: RestBinding_annotation.patch
>
>
> Attached is a patch that enables one to bind a rest verb to a specific handler in your ActionBean. An example:
> @UrlBinding("/RestAction")
> public class RestActionBean implements ActionBean {
>   @RestBinding("PUT")
>    public Resolution myPutHandler() {
>        log.info("Got a Put");
>        return null;
>    }
> }
> Now if you send a PUT request to "/yourapp/RestAction", it will be routed to the "myPutHandler" method.
> The patch needs a little review & clean-up before committing. Ben's had at least a quick look at it at this point.

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (STS-774) Resolve event handler by HTTP verb (RestBinding)

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

    [ http://www.stripesframework.org/jira/browse/STS-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12520#comment-12520 ]

Wiley Fuller commented on STS-774:
----------------------------------

Is this patch likely to make it into 1.5.7 ?

> Resolve event handler by HTTP verb (RestBinding)
> ------------------------------------------------
>
>                 Key: STS-774
>                 URL: http://www.stripesframework.org/jira/browse/STS-774
>             Project: Stripes
>          Issue Type: New Feature
>            Reporter: Evan Leonard
>         Attachments: RestBinding_annotation.patch
>
>
> Attached is a patch that enables one to bind a rest verb to a specific handler in your ActionBean. An example:
> @UrlBinding("/RestAction")
> public class RestActionBean implements ActionBean {
>   @RestBinding("PUT")
>    public Resolution myPutHandler() {
>        log.info("Got a Put");
>        return null;
>    }
> }
> Now if you send a PUT request to "/yourapp/RestAction", it will be routed to the "myPutHandler" method.
> The patch needs a little review & clean-up before committing. Ben's had at least a quick look at it at this point.

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development
Reply | Threaded
Open this post in threaded view
|

[JIRA] Commented: (STS-774) Resolve event handler by HTTP verb (RestBinding)

JIRA jira@stripesframework.org
In reply to this post by JIRA jira@stripesframework.org

    [ http://www.stripesframework.org/jira/browse/STS-774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12870#comment-12870 ]

Remi VANKEISBELCK commented on STS-774:
---------------------------------------

We were discussing this on IRC : can't this be done without hasking Stripes, just by using a custom ActionResolver in the app ?

There's a method for retrieving the event handler to be invoked :

net.sourceforge.stripes.controller.ActionResolver#getHandler

As usual, it ain't dynamic : you don't have access to the HttpServletRequest. But as usual, you can grab it from :

net.sourceforge.stripes.controller.ExecutionContext#currentContext

I'd like to close that ticket if it's ok for everyone, as it can be done without patching Stripes. Moreover the feature doesn't seem to be very popular, it's been hanging in the JIRA for too long without activity.

> Resolve event handler by HTTP verb (RestBinding)
> ------------------------------------------------
>
>                 Key: STS-774
>                 URL: http://www.stripesframework.org/jira/browse/STS-774
>             Project: Stripes
>          Issue Type: New Feature
>            Reporter: Evan Leonard
>         Attachments: RestBinding_annotation.patch
>
>
> Attached is a patch that enables one to bind a rest verb to a specific handler in your ActionBean. An example:
> @UrlBinding("/RestAction")
> public class RestActionBean implements ActionBean {
>   @RestBinding("PUT")
>    public Resolution myPutHandler() {
>        log.info("Got a Put");
>        return null;
>    }
> }
> Now if you send a PUT request to "/yourapp/RestAction", it will be routed to the "myPutHandler" method.
> The patch needs a little review & clean-up before committing. Ben's had at least a quick look at it at this point.

--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Stripes-development mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/stripes-development