This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes why Not encodeDispatchURL  ???? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "why Not encodeDispatchURL  ????" Watch "why Not encodeDispatchURL  ????" New topic
Author

why Not encodeDispatchURL ????

Ganesh.P Ram
Ranch Hand

Joined: Dec 22, 2005
Posts: 41
Hi All,

My understanding about encodeURL is that, if the cookies are not enabled, then the container creates the session id and passes it along with response and similarily gets the sessionId through the request that the client sends.

encodeRedirectURL is used when I redirect to another servlet (again cookies are not enabled), and that servlet makes use of this session Id ?

My question is: why dont we have a similar method for encodeDispatchURL - so that the servlet to which the request is dispatched can make use of the sessionId.

Please clarify!!!

Ganesh


Ganesh
P Chittaranjan
Ranch Hand

Joined: Feb 09, 2006
Posts: 47
Because dispatch action is performed at server side.And during dispatch we are passing the request and response object.

Since the same request and response object available in the forwarded or included servlet/jsp, we don't need to encode it.

Thanks


Thanks,<br />Chittaranjan<br />SCJP 5.0,SCWCD1.4,SCBCD 5
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: why Not encodeDispatchURL ????
 
Similar Threads
no cookie
cookies and URL rewriting
jsessionid always appended to urls on first request
HFSJ Final mock Q
response.encodeURL