• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Mock exam question on encodeURL

 
Ranch Hand
Posts: 188
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the following is an example of URL rewriting by using encodeURL(String url)

1) http://localhost:8080/servlet/play;jsessionid=56
2) http://localhost:8080/servlet/play
3 ) http://localhost:8080/servlet/play?jsessionid=56
4 ) None of the above


The answer given is 1 and 2

Why is the third one wrong ?? Is it that encodeURL(..) is always going to use ; instead of ?

Thanks
 
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the "?" denotes the start of the query string which has nothing to do with URL rewriting. Thaa is why it is not a correct answer
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic