Avatar of gudii9
gudii9
Flag for United States of America asked on

servlet encodeURL method

Hi,

I read as

servlet encodeURL method server-side forwards and includes. I wonder why we do not need in these cases.
please advise
Any links resources ideas highly appreciated. Thanks in advance
Java EEJavaJSP

Avatar of undefined
Last Comment
rrz

8/22/2022 - Mon
rrz

Your  question is  not clear.  But I'll try to help you anyway.  
The encodeURL method is used to add session id to a url if a session cookie is not used by client.  It is used to prepare the response to be sent to the client.
>forwards and includes      
These are server side actions. The server already knows the session id. So, there no need for encoding the url during these actions.
gudii9

ASKER
These are server side actions. The server already knows the session id. So, there no need for encoding the url during these actions.

But for the very first time user interacts with the server  then server does not know if cookies are used or session id is being used right? Even that case also servlet encodeURL method not needed for server-side forwards and includes? please advice
ASKER CERTIFIED SOLUTION
rrz

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck