• Post Reply Bookmark Topic Watch Topic
  • New Topic

Mock exam question on encodeURL  RSS feed

 
Sudarshan Sreenivasan
Ranch Hand
Posts: 188
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • 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
 
Michael Ku
Ranch Hand
Posts: 510
  • Mark post as helpful
  • send pies
  • 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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!