Professional Documents
Culture Documents
You have
accidentally closed the browser window. Will the database transaction continue or will
get over?
2. What is the difference between http GET and POST methods ?
3. There are 10 servlets in your web application, and they are frequently used (sticky
Servlet). How will you optimize their loading?
4. How will you communicate across Servlets? (or, how will you achieve Inter
Servlet communication?)
5. Hope, you know the difference between RequestDispatcher.forward() and
RequestDispatcher.sendRedirect(). So, which one is desirable to use?
6. What is the class path hierarchy for a Servlet?
7. You can’t read files (located out of tomcat directory) from JSP and Servlets for
security purpose. But, how will you access those files from JSP or Servlets, in case if you
need them?
//tnis outside class where you can call getName() method but you will get same Instance
You will need to set the appropriate HTTP header attributes to prevent the dynamic
content output by the JSP page from being cached by the browser. Just execute the
following scriptlet at the beginning of your JSP pages to prevent them from being cached
at the browser. You need both the statements to take care of some of the older browser
versions.
<%
If i am thinking in the right direction u want to only update a portion of the page
not the entire page.
setTimeout("window.location.reload()",1000)
Enter this script in the head portion of the html page in script tags
But the best solution is to use AJAX. If you are using gmail or meebo u would
understand what it is all about.
cheers
Re: How we can check in particular page the session will be alive or not Answer
#3
when we create session , we write
HttpSession session= res.getSessionn(true);
this checks whether there is a session bind on associated
request.if yes then it returns reference to session
object,otherwise create a session for associated request.