Sie sind auf Seite 1von 2

SessionID : 1) What is Session ID?

Answer: A session ID is an unique identification string usually a long, random a nd alpha-numeric string, that is transmitted between the client and the server. Session IDs are usually stored in the cookies, URLs (in case url rewriting) and hidden fields of Web pages. 2) Question: What is Session Tracking? Answer: HTTP is stateless protocol and it does not maintain the client state. Bu t there exist a mechanism called "Session Tracking" which helps the servers to m aintain the state to track the series of requests from the same user across some period of time. 3 ) Question: What are different types of Session Tracking? Answer: Mechanism for Session Tracking are: a) Cookies b) URL rewriting c) Hidden form fields d) SSL Sessions 4) Question: What are the advantage of Cookies over URL rewriting? Answer: Sessions tracking using Cookies are more secure and fast. Session tracki ng using Cookies can also be used with other mechanism of Session Tracking like url rewriting. Cookies are stored at client side so some clients may disable cookies so we may not sure that the cookies may work or not. In url rewriting requites large data transfer from and to the server. So, it le ads to network traffic and access may be become slow. Question: What is session hijacking? Answer: If you application is not very secure then it is possible to get the acc ess of system after acquiring or generating the authentication information. Sess ion hijacking refers to the act of taking control of a user session after succes sfully obtaining or generating an authentication session ID. It involves an atta cker using captured, brute forced or reverse-engineered session IDs to get a con trol of a legitimate user's Web application session while that session is still in progress. 5) Question: What is Session Migration? Answer: Session Migration is a mechanism of moving the session from one server t o another in case of server failure. Session Migration can be implemented by: a) Persisting the session into database b) Storing the session in-memory on multiple servers. 6) Difference between HashMap and HashTable? A: The HashMap class is roughly equivalent to Hashtable, except that it is unsyn chronized and permits nulls. (HashMap allows null values as key and value wherea s Hashtable doesnt allow). HashMap does not guarantee that the order of the map will remain constant over time. HashMap is unsynchronized and Hashtable is synch ronized. 7) Q: Can an application have multiple classes having main method? A: Yes it is possible. While starting the application we mention the class name to be run. The JVM will look for the Main method only in the class whose name yo

u have mentioned. Hence there is not conflict amongst the multiple classes havin g main method. 8) DIff between SAX and DOM parser SAX: 1. Parses node by node 2. Doesnt store the XML in memory 3. We cant insert or delete a node 4. Top to bottom traversing DOM 1. Stores the entire XML document into memory before processing 2. Occupies more memory 3. We can insert or delete nodes 4. Traverse in any direction. If we need to find a node and doesnt need to insert or delete we can go with SAX itself otherwise DOM provided we have more memory. SAX Parser is the one which is developed to run the java programs especially. It uses a memory resident model. DOM is developed by w3c consortium so that it is an open standard. In DOM the xml file is arranged as a tree and backward and for ward search is possible for searching the tags and evaluating the data which it holds. It depends upon the application and ease of data accessiblity. If we want to extract the data from a xml file once we have to move to SAX which is one ti me top to bottom read approach and if we want ot randomly pick the data in an xm l file then the tree reperesentation of DOM model is to be put into use

Das könnte Ihnen auch gefallen