Top JSP Interview Questions :: ALLInterview.com http://www.allinterview.com Top JSP Interview Questions en-us how to maintain sessions in jsp?can you tellme the methods. http://www.allinterview.com/showanswers/8622.html using session oject in jsp. first u set using following methods String name="ravi"; session.setAttribute("user",name); using retrive method String sessionuser=session.getAttribute(name); out.println("welcome what is difference between redirect and forward method? http://www.allinterview.com/showanswers/6670.html * redirect method is created a new webpage. * forward method is forward to existing pages. What is the use of Application Object and Session Object in JSP? http://www.allinterview.com/showanswers/6877.html Application object is used to maintain the information related to the current webapplication which is running in the webcontainer. Session object is used to maintain the information related to the browser from which the user gets the request Can we use methods in JSP? If so where the methods are stored in ser http://www.allinterview.com/showanswers/4097.html Yes we can write java methods inside jsp files within the "declarations" tag <!%//the method%>. This part of the code is compiled by the servlet engine and inserted outside the _jspservice() method in the generated servlet cl How do you import the packages in the JSP? http://www.allinterview.com/showanswers/6850.html eg: <%@ page import =?java.util.Vector,java.util.Map? %> What Do you Mean By Object Serialization in java. http://www.allinterview.com/showanswers/23615.html Object Serialization extends the core Java Input/Output classes with support for objects. Object Serialization supports the encoding of objects, and the objects reachable from them, into a stream of bytes; and it supports the complementary recons how can we retrieve the values in jsp by using custom tags http://www.allinterview.com/showanswers/16542.html I think using EL expressions can be used . El expressions internally uses getAttribute method to retrive the values in jsp by using custom tags What is the difference between &lt;jsp:forward&gt; and sendRedirect? http://www.allinterview.com/showanswers/6847.html Using <jsp:forward> you can forward the request and response object to the concern URL. Where as in sendRedirect, it will not carry the request and response object details. How to implement a thread-safe jsp page? http://www.allinterview.com/showanswers/6694.html just add the directive <%@ page isThreadSafe="false" %> with the jsp page.. How does the Jsp Expressions works ? What happens at the back? http://www.allinterview.com/showanswers/11008.html jsp expressions are evaluated at the run time, jsp compiler evaluates the expressions at the run time. How many page directive we can use in a single JSP? http://www.allinterview.com/showanswers/4096.html language import session buffer isThreadSafe ErrorPage isErrorPage Info contentType pageEncoding isELIgnore autoflush Are application, pageContext and object of ServletContext same or no http://www.allinterview.com/showanswers/23752.html application and object of ServletContext are same. In jsp page application implicit variable represents object of ServletContext but pageContext represent object whose super class is SerlvetContext. the class of PageContext has some convinian which situation you use static include and dynamic include in jsp? http://www.allinterview.com/showanswers/56238.html when same request and response objects are shared by multiple JSP's in dynamic include In static include internally,it will merge the contents(eg: one.jsp and two.jsp) and creates a jsp as(one_two.jsp)then generates the output of both t Explain about the Scriplet and Exclamatory Tag? http://www.allinterview.com/showanswers/6849.html Scriplet tag is one of the JSP tag, it will replicate the entire code in the service method. In the exclamatory Tag, you can define the Global variables and write the user defined methods. What are JSP scripting elements? http://www.allinterview.com/showanswers/1446.html Templates Scriptlets Declaratives ststements TagLibDirectives