cancel
Showing results for 
Search instead for 
Did you mean: 

Two GETs instead of a GET and a POST...?

oofdachile
Champ in-the-making
Champ in-the-making
Hi, folks –

This helpful file-upload example …

http://wiki.alfresco.com/wiki/Web_Scripts_Examples#File_Upload

… has an upload.get.desc.xml description and and an upload.post.desc.xml:  I think this means that the first one requests the upload form, and the second, specified as the action for the upload form, performs the actual upload & shows the results.  Because they each use a different method, they can share the same action or URL.  Very cool.

But suppose you wanted to create a search-form / search-results pair, which would instead use two GET methods: one GET to fetch the custom search form, and the other GET to execute the search with the form's criteria and return the search results.  Presumably the two cannot coexist like the pair that make up the example above:  is this not so?  I would guess that there'd need to be a "pizzaSearchForm.get.desc.xml" and a "pizzaSearchResults.get.desc.xml", each with its respective <url></url> entries, or am I just better off sticking with frozen pizza?

I'll bet this has been covered here already, but my searches didn't turn up the thread.

TIA!

Don
3 REPLIES 3

lementree
Champ on-the-rise
Champ on-the-rise
Hi,

You can use "pizzaSearchForm.get.desc.xml" and  "pizzaSearchResults.get.desc.xml". It is not compulsary to use post.

mrogers
Star Contributor
Star Contributor
With Get URLs you tend to put parameters on the URL so you could differentiate the two e.g. have pizzaSearchForm with no parmeters will  show the form and pizzaSearchForm&query=ABC which runs the query and returns results.

oofdachile
Champ in-the-making
Champ in-the-making
Thanks for the prompt replies!  It sounds like a web script is defined by its name and its method, so one cannot have more than one name/method pair.  This seems to mean that designing a family of web scripts to work together could address this issue, or that careful design of one web script may eliminate the need for the second GET.  Give me a shout if I've misunderstood either of you.

Don