my dog learned polymorphism*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes URL ReWriting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "URL ReWriting" Watch "URL ReWriting" New topic
Author

URL ReWriting

Venkat Perumalla
Greenhorn

Joined: Sep 19, 2006
Posts: 20
Hi,

Can anyone make me clear on URLRewriting concept and why can they be used for static pages

Thanks in Advance !!!


Venkata Gawtham Perumalla<br />"Wise People Learn from their Mistakes Wiser People Learn from Others Mistakes"
Dirk Lombard
Greenhorn

Joined: Jul 27, 2005
Posts: 18
You use URL rewriting when the client has disabled cookies on the browser. URL rewriting takes the session ID that is in the cookie and stick it right onto the end of every URL that comes in to the application. The Container will strip of this extra part of the request URL and use it to find the matching session when a user request something from a link. All of this is necessary because HTTP is stateless so you cannot keep track of a users session unless you use cookies or URL rewriting.

Why it cannot be used in static pages (html) is for the same reason you can not use scripting and EL in static pages. HTML is not turned into some sort of JAVA class that will be executed. With a JSP the scripting or EL code is turned into JAVA code when the JSP is transformed into a servlet class that will be executed and the response send to the browser. You need a response.endcodeURL or <c:URL> to encode the URL for you and it will only work in a dynamic page.


SCJP 1.4<br />SCWCD 1.4
Venkat Perumalla
Greenhorn

Joined: Sep 19, 2006
Posts: 20
Thanks Dirk
 
 
subject: URL ReWriting
 
Similar Threads
Can the color for the disabled item be changed
WA #1.....word association
Private methods
URGENT - NEED HELP - Block Code
error in Marcus Green 2.