aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Usage of GET and POST? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Usage of GET and POST?" Watch "Usage of GET and POST?" New topic
Author

Usage of GET and POST?

Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 110
Regarding: book Head First Servlets & JSP, page 111, second paragraph.

1) What is meant by 'cannot be bookmarked'? I could as well just go to a form POST page and bookmark it, but then it wouldn't work because when I would visit it again, e.g. the form data would be gone.

2) "The users might want to come back a week later and try the same search again now that there's new data on the server". What does this mean? Does it mean that it woul be bad to allow a GET request on a search box? I see it as an advantage of not having to fill in the search terms again.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61768
    
  67

1) Yes, bookmarking a POST is not all that useful. That's why a pattern like the PRG Pattern (described in this article) is preferred. That way, dangling POSTs are never left on the page for people to bookmark. It also prevents an annoying browser message when refreshing, or the accidentally replaying of destructive POST action.

2) I believe it's saying that bookmarking the GET with its complete URL is a good thing as it's easy for the user to "replay" the search at a later time.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Ryan McClain
Ranch Hand

Joined: Nov 27, 2010
Posts: 110
When you bookmark something, what is actually being bookmarked? Just the request line (GET http://path.to/resource.ext?querystring) - or are headers and the body bookmarked as well?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42945
    
  68
Only the URL.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Usage of GET and POST?