JSP Question - encodeURL

Posted on 2001-06-08
Last Modified: 2010-03-31

From what i understand encodeURL can be used to put session information in the URL, if cookies are disabled.

I am developing a website with JSP pages, where User is not supposed to login. It is a content website, which anyone can come and browse, and i dont care for tracking sessions of users.

Should i use response.encodeURL in this case ???

Since, i dont bother about sessions, why should i use encodeURL at all ?

Pls throw some light on this.

Question by:Jitu
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

sghosh092199 earned 50 total points
ID: 6169198
The doc says, 'All URLs emitted by a Servlet should be run through this method'. However, if encoding is not necessary it will return the URL unchanged, though.

Expert Comment

ID: 6169258
You are correct, you do not need to use it unless you want to use the functionality of sessions through url rewriting -- that is the only purpose of encodeURL.

Expert Comment

ID: 6170767
hi ,
There is another use of encoding URL.

 Suppose you have two JSPs.

1.One with name as "Hello  World.jsp" .(Two space between "Hello" and "World").

2.Other is "Login.jsp" (this contain link to above jsp).

If u click the "Hello  World.jsp" link in  "Login.jsp" Netscape throws 404 error, Incase you are not encoeded that URL.(Because of blank space).

If that URL is encoded Netscape automatically replace blank space with "%20" and Correctly display the page.

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Expert Comment

ID: 6171100

  I believe the functionality you are describing is actually done with the object and not response.encodeURL.


Expert Comment

ID: 6842679
Question(s) below appears to have been abandoned. Your options are:
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, in the event new items have been created since this listing was pulled.

To view your open questions, please click the following link(s) and keep them all current with updates.

To view your locked questions, please click the following link(s) and evaluate the proposed answer.

------------>  EXPERTS:  Please leave any comments regarding this question here on closing recommendations if this item remains inactive another three days.
Thank you everyone.
Moderator @ Experts Exchange
P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.

Expert Comment

ID: 6897410
Force-accepted by
CS Moderator

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
hibernate insert example 13 38
Tomcat: Unable to run tomcat service. 2 29
mysql jsp example issue 32 70
learn programming 8 66
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
The viewer will learn how to implement Singleton Design Pattern in Java.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question