This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

oh why not push another question  RSS feed

 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which of the following best describes an example of url rewriting
a) out.println("<input type=hidden name='name' value='billybob'"> ;
b) out.println("<form action='/servlet/testservlet/billybob' method='post'>");
c) HttpSession session = req.getSession();
d) session.addAttribute("name", "billybob");
e) none of the above
book answer:
B - URL rewriting consists of adding data to the URL The receiving servlet can then extract the additional information to utilize the data.
my answer would be:
E.
b is not url rewriting since that should have been done programmatically and this is hardcoded.
I do agree to a point that B can be url rewriting if the writer of this servlet always wants to add billybob as extra pathinfo. But wouldn't that be pointless and therefore a complete wrong example ?
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi my answer would be E too.Coz URL rewriting is done for browsers that dont support cookies & the j_sessionid if rewritten in the URL path.How can the answer be B,I dont understand?Which is this book you are using, may i know?
 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one small correction.The name of the session tracking cookie is JSESSIONID.
Regards,
Maha Anna
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!