On Tue, Sep 28, 2010 at 7:08 AM, Thiago H. de Paula Figueiredo < thiag...@gmail.com> wrote:
> On Tue, 28 Sep 2010 05:41:50 -0300, Lutz Hühnken < > lh.tapestry.l...@googlemail.com> wrote: > > Dear Thiago, >> > > Hi, Lutz! > > > now this - the lack of <form method=get> - is something that has been >> puzzling me in Tapestry 5 for a long time. > > Oh well, I'm not alone ;-). Particulary because doing this by hand is too much burden and you cannot use any of the components already provided by tapestry. > Why would you say using >> "GET" is a bad idea? >> > > Because all field values end up in the URL. That's exactly what makes it a good idea, in particular for the case described below. Also this allows the application to easily interoperate. Think all those sites that provides a GET interface to search that can be easily integrated with browsers (ej, the search box in firefox). > The use case I think of is a search field. You enter a search term, >> submit the form, get the result. I think using a form with method=get >> is the absolutely correct thing to do to achieve this. >> > > I disagree 100%. Why not POST? > GET was always meant to be used in request that don't change the state of > the application (including database), while POST for requests that change > the state. In addition, Tapestry uses redirect-after-post by default (a very > good thing), so using GET would be useless anyway. Search Google for "get vs > post security" for some info and "redirect-after-post". Note the use case, is a search which will not change the database or application state. I do agree with Lutz, there are cases where GET is much more appropriate than POST. Not just because it makes more sense but also because it gives you a bookmarkable URL. That being said, I just love default redirect-after-post for those forms that *actually* modifies the application state, just this is not the only use case. > Of course I am willing to learn. What would be the "Tapestry way" of >> implementing this? >> > > Use Form and leave it using POST. If you want a bookmarkable URL, use the > page activation context instead. Tapestry and the form field components do > all the value handling for you. Of course is a matter of taste but I rather have http://localhost/?q=cálculo+diferencial<http://localhost/?q=c%C3%A1lculo+diferencial>than http://localhost:8080/C$00e1lculo$0020diferencial Regards, Manuel.