• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Head First Servlets - Sharpen Pencil - page 19

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure if its been asked before. I did not find any threads for this. This is the GET or POST SHRPEN YOUR PENCIL. I want to compare my answers with what the author thinks is right. Thanks very much.
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not sure either - but here's my answers for a sanity check!
1. POST - wouldn't want a password (confidential info) to be displayed in the address bar which it would be if GET were used.
2. GET - get's can be bookmarked and the user might want to bookmark the new page.
3. POST - text might be too long for GET and/or may contain confidential info they would not want displayed.
4. POST & GET - depends on the information being sent (if confidential or lots of info, then POST. If no info or unimportant info, then GET)
5. Hmmm. POST I guess, since there might be some confidential info even on logout at a secure site. If not you might get away with GET?
6. POST or GET - depending on what was used to get the page last time.
7. POST - I'd treat address information as confidential so wouldn't want it in the browser address line. It could be a long address too.
8. GET - There's nothing too confidential about a radio button selection that I have come across.

Hope this helps!
If anyone disagrees feel free to comment!

Cheers,
Roger
SCJP 1.2,1.4
SCBCD 1.3
Studying for SCWCD
 
Roger Yates
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess strictly speaking for 8. you wouldn't use either since a mere radio button selection shouldn't take you to another page, but I'm assuming that having made the selection the user hits a 'submit' button or similar!
 
Ritu varada
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess for question 8, there are assuming a submit and then asking us to think about the method. Sounds foolish and impractical but strictly speaking, maybe both could apply. Clicking on a radio button might lead to a link to a page or update the database (although we wouldn't put that in a radio button selection.) But, thanks for your comments. I can move past the page now! Happy reading!
 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,


Get or Post?

A user hits the 'back' button on the browser



I guess there could be NO post or get request sent to the server at all. The browser could just use its locally cached page, therefore the server would not get hit with post/get request.

What do you think?


[ October 24, 2004: Message edited by: Alex Sharkoff ]
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Quote:
5. Hmmm. POST I guess, since there might be some confidential info even on logout at a secure site. If not you might get away with GET?

--------------------------------------------------------------------
when logout, it should not bring any information, So I guest 'GET'.
 
Romy Huang
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,


quote:
--------------------------------------------------------------------------------

Get or Post?

A user hits the 'back' button on the browser

--------------------------------------------------------------------------------



I guess there could be NO post or get request sent to the server at all. The browser could just use its locally cached page, therefore the server would not get hit with post/get request.

What do you think?
-------------------------------------------------------------------

I use 'GET', because it is same as hiting http link
 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Get or Post?

A user hits the 'back' button on the browser



That would depend.

If the page was accessed by a simple GET AND the cache hasn't expired then I would have to say use the cache.

If the page was accessed by a simple GET and the cache has exipred (or no caching), GET (again).

If the page was accessed by a POST the simple answer is POST again. The drawn out answer is browser dependent.

For this question I answered Both, which is currently not an option
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic