aspose file tools*
The moose likes General Computing and the fly likes web browser internal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "web browser internal" Watch "web browser internal" New topic
Author

web browser internal

jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
I like to know how the web browsers which are the real clients, work. If you can send me a url containing these information that will be appreciated.

The actions refresh, back, clicking on a hyperlink, clicking on a button, submitting a form etc may or may not create an HttpRequest. I like to know which among these actions create requests and which utilizes the information in browser cache.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61603
    
  67

Moved to General Computing


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Most commands/actions in a browser window that load a page (refresh, submit, clicking a link) in any way create a HttpRequest with the exception of the back button. Images are not re-requested if the image is all ready in the cache.

This 'hole' in the back buttons means someone can work with live data, change it, then use the back button to see the old data which is clearly out of sync with the server, and then work with that or resubmit it leading to potentially very corrupt data. As a contrived example, imagine you work with data such as a server-stored session shopping card (not a cookie). You then delete an item in the card. You then use the back button to modify items that have been deleted. The server may not be able to handle this confusing behavior because you have deleted items you now want to update.

As a 'fix', many application servers disable the back button in one way or another that avoid this behavior. For example, I'm sure many of you have tried to hit the back button while placing an order and gotten an error message or a blank page saying not to use the back button. What is happening here is that the javascript on the page is set to detect when the page has been reloaded and either display an error message or force a reload of a page that would normally be available in the cache.

Therefore, there are artificial occassions where the back button will trigger a refresh from the server.


My Blog: Down Home Country Coding with Scott Selikoff
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
Thanks for the response. Here are some more questions.
1. I am assuming that when back button is hit the browser redisplays the previous page from the cache. Is the whole page is being stored in cache?

2. A back operation succeeding a Get operation is normally successful. But a back succeeding a Post operation is not. Why does it differ? I know the parameters are in the http header during a 'Get'; the parameters are in the http body during a post operation. But how does it matter to the browser whether only "only header is in http request" or "both header and body is in http request".

3. In java ranch form posts, while we are creating a postable item (clicking post reply), we can actually go back and forward before form submission, without the new data being lost. You can click on post reply, the "post a reply" page with input text area will be displayed; You type in your text then click back, then forward; You will see that your typed in new data is preserved. How is this data preservation accomplished?

4. When we type in a url representing a page containing one picture, how many requests go to the server? How does the browser identify the url for the picture?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: web browser internal