dcsimg
Real difference between posting a form and entering a URL manually
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   joey_corleon
Posted On:   Wednesday, January 21, 2004 02:50 PM

Hi, Let's say I have an action form called "makeSomeAction_Action". What is the difference between sending a form to this action (using standard Struts FORM & HTML tags) and simply using a Struts forward link appending the same parameters as the ones from the earlier form using ?name=ludovic&name=marcial bla bla bla syntax? At the end of the day makeSomeAction_Action will be reached (process() method), and if, in the second solution, I use DynaForm functionality I can even very easiely retrieve the elements passed as parameter... The second interrogation is the following: It seems that when I use solution 2, the web browser do the following nasty (and ex   More>>

Hi,


Let's say I have an action form called "makeSomeAction_Action".


What is the difference between sending a form to this action (using standard Struts FORM & HTML tags) and simply using a Struts forward link appending the same parameters as the ones from the earlier form using ?name=ludovic&name=marcial bla bla bla syntax?


At the end of the day makeSomeAction_Action will be reached (process() method), and if, in the second solution, I use DynaForm functionality I can even very easiely retrieve the elements passed as parameter...


The second interrogation is the following:


It seems that when I use solution 2, the web browser do the following nasty (and expected) thing: If I click on the browser's "previous page" and "next page" button, the request (which in my case is used as a kinda POST) is re-submitted.


Why does this don't happen (which is good) with "real" forms?



Thanks.

   <<Less

Re: Real difference between posting a form and entering a URL manually

Posted By:   Jerome_Iffrig  
Posted On:   Thursday, January 22, 2004 12:35 AM

The question you actually are asking yourself is :-


What is the difference between a "GET" and a "POST" ...

Simply GET (used by a href .etc...) is ususally used used to **get** a document from a webserver, whereas POST (usually used by HTML forms) is usually used to **post** information to the webserver -


In almost all instances one can configure the HTML tag so it uses one method rather than the other (it is not necessary ment to be used this way, but it works ... as long as you know what you are doing!).


One of the main difference is that the POST does not get cached by the URL bare of the browser.


For more information on these differences, please have a look for the key words POST vs GET in a WWW search engine.



Jay-

About | Sitemap | Contact