JSP Java Interview Questions – Set 08

How do you restrict page errors display in the JSP page You first set “Errorpage” attribute of PAGE directory to the name of the error page (ie Errorpage=”error.jsp”)in your jsp page .Then in the error jsp page set “isErrorpage=TRUE”. When an error occur in your jsp page it will automatically call the error page. How … Read more

Servlet Java Interview Questions – Set 08

What is JSP tag file A source file containing a reusable fragment of JSP code that is translated into a tag handler when a JSP page is translated into a servlet. What is JSP container A container that provides the same services as a servlet container and an engine that interprets and processes JSP pages … Read more

Multi Threading Java Interview Questions – Set 08

What is the difference between sleep(), suspend() and wait() Thread.sleep() takes the current thread to a “Not Runnable” state for specified amount of time. The thread holds the monitors it has acquired. For example, if a thread is running a synchronized block or method and sleep method is called then no other thread will be … Read more

JSP Java Interview Questions – Set 07

How can I set a cookie and delete a cookie from within a JSP page Cookie mycook = new Cookie(“name”,”value”); response.addCookie(mycook); Cookie killmycook = new Cookie(“mycook”,”value”); killmycook.setMaxAge(0); killmycook.setPath(“/”); killmycook.addCookie(killmycook); What is JavaServer Pages Standard Tag Library (JSTL A tag library that encapsulates core functionality common to many JSP applications.JSTL has support for common, structural tasks … Read more

Servlet Java Interview Questions – Set 07

When init() and Distroy() will be called init() is called whenever the servlet is loaded for the first time into the webserver.it performs certain one time activities which are required during the lifetime of the servlet.It may be some initialisation of variables or a database connection. Destroy will be called whenever the servlet is removed … Read more