Hi, I was trying to experiment with the use of encodeURL( String). I did the experiment with getSession() and encodeURL(). The code is shown and the problem is mentioned below the code.
It is found that if I use getSession() (As shown above. encodeURL is commented) , the execution goes to "else" part whenever I refresh the page. When I comment getSession() and include the encodeURL("." ) line, execution never goes to the else part..Could anybody point out the mistake.. I am using Tomcat 5.5 as my server.
This problem is not related to encodeUrl, but with the way you are using getSession. Calling getSession() will return an existing session, or create a new one if it doesn't already exist. If you comment this out, no session will be created, so you'll always end up in the if{}. If you leave it, you'll end up in the else{} after the session has been created.