Friday 24 December 2010

URL Rewriting

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

session tracking

session tracking:
is a process of maintaining / tracking the user data in a session.
Session: is an uninterrupted set of request and response between a client and server.
Advantages:
This helps improving the communication with the client also gives convenience avoiding asking the same data repeatedly.
Example:
Ecommerce:
1). Flipcart
2) snapdeal
To maintain the cart all most every website is using session tracking to remember the login user.
Session tracking can be implemented in 4 ways:

1.      URL Rewriting
2. HTML Hidden Form Filed
3.       Cookie
4.       HttpSession
·         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

session management (http://raj-servlets.blogspot.com/2013/09/session-management.html)
Session tracking types:




More articles on
Session management or session tracking



what is session ?

session is an uninterrupted set of request and response between a client and server.


example project on session tracking (hidden form , url rewriting, forward, include)