This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
in hfsj book they mentioned this code in doGet method.
Which page exactly are you talking about. Please post a little excerpt from the code to show us actually what that code is doing. In a servlet URL rewriting can be done using HttpServletResponse.encodeURL/encodeRedirectURL and in JSPs it can be done using c:url tag...