24 March, 2012

j2ee notes

session management technique


1. Cookie: 
          Place a text stored on user computer by browser. It can be used for authentication, shopping cart. It consists of name-value pair. It is sent in the header of the request


2. HttpSession: 
           This is used by servlet. When a session is created a cookie containing a sessionId is stored on user hard drive. The name of the id is jsessionid. Session has a life time which is defined inside web.xml


3. Hidden forms: 
   <input type="hidden" name="session" value="1234"/>
This means that when the form is submitted, the name and value are automatically included in the GET and POST data. This has disadv. that it works if the page is dynamically submitted by the form submission.


4. URL Rewriting:
     some extra data is applied on the end of each URL. That data identifies the session and server associate that id with user specific data. For ex. http://abc.com;jsessionid=a1234. The sessionid here is jsessionid=1234. 
It works well if user has disabled cookies.

What is Facade Layer?

  • This layer encapsulate business logic and business data and expose their interfaces.
  • Provide a simpler interface to the clients by hiding all the complex interactions between business components.
  • Reduce the number of business objects that are exposed to the client.
  • Hide from the client the underlying interactions and inter-dependencies between business components.
  • Avoid exposing the underlying business objects directly to the client to enhance the loose coupling between the two tiers to a minimum.

No comments:

Post a Comment