URL Rewriting:
·
This is one of approach of implementing session
tracking
·
In this approach we rewrite the URLs in the
response message adding the data to maintain for the next request
Note:
·
The Session
data here can be added into the URL
·
The url either in the form of QueryString or
path info
·
In case of query string we separate the URL with
? char
·
We can read this data as request parameter
·
In case of path info: first we need to configure
the URL pattern for the servlet as path mapping. And in the program we can read
it using getPathInfo() or
getRequestURI() method.
What are the limitations of this approach?
·
The Session
data is maintained in URL.
·
THE size and type of content is restricted
·
URL Rewriting is not secure
·
All the pages in the Session
should be dynamic
·
Increases the dependency: as all the possible
pages processing the request between the sources and target pages should
implement URL Rewriting
Note:
We prefer the URL Rewriting in case of maintaining
non-sensitive, small and simple text data in short length Sessions
More articles on