struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Musachy Barroso" <musa...@gmail.com>
Subject Re: REST Again
Date Thu, 08 Jan 2009 16:23:52 GMT
ok, here we go. Looking at the rest showcase application, when you hit this url:

/orders/10

the REST plugin (to simplify) says "I have to invoke the 'show' method
in the 'orders' action, and set its 'id' parameter to 10". How does
the REST plugin know what to invoke? based on some simple convention
rules which are defined in the documentation:

    * GET: /movies => method="index"
    * GET: /movies/Thrillers => method="show", id="Thrillers"
    * GET: /movies/Thrillers;edit => method="edit", id="Thrillers"
    * GET: /movies/Thrillers/edit => method="edit", id="Thrillers"
    * GET: /movies/new => method="editNew"
    * POST: /movies => method="create"
    * PUT: /movies/Thrillers => method="update", id="Thrillers"
    * DELETE: /movies/Thrillers => method="destroy", id="Thrillers"

so, the REST plugin based on some conventions, saves you the time of
having to define the mappings for the actions and results, among other
things.

musachy

On Thu, Jan 8, 2009 at 11:13 AM, Frans Thamura <frans@meruvian.org> wrote:
> hi there
>
> chat with musa
>
> and he said that REST create the "action" for us
>
> but i still dont get,
>
> first Struts without REST, 1 action 1 result
>
> in REST, 1 result multiple action and mapped as REST URL
>
> can help all
> --
> --
> Frans Thamura
> Meruvian
> One Stop Java and Enterprise OSS Provider
> Technopreneurship, Training, Internship, Outsourcing and Corporate
> Competency Center
>
> Mobile: +62 855 7888 699
> Blog & Profile: http://frans.thamura.info
>
> Training JENI, Medallion (Alfresco, Liferay dan Compiere).. buruan...
> URL: http://www.meruvian.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>



-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message