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 the difference between JSP and Servlet? http://www.allinterview.com/showanswers/64734.html Jsp is better for preparing presentation pages, while servlet is good for request processing as it's more difficult to write include, forward a static or dynamic url with in out.println() , Jsp has also all implicit objects, we need not 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 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. 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 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 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 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 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 are JSP ACTIONS? http://www.allinterview.com/showanswers/1440.html JSP actions use constructs in XML syntax to control the behavier of the servlet engine.you can dynamially insert a file, reuse Java Beans Components,forward the user to another page,or generate HTML for the java plugin.Available actions include: What are implicit objects? http://www.allinterview.com/showanswers/1443.html To simplify code in JSP expressions and scriptlets, we can use eight automatically defined variables, called implicit objects. They are request,response,out,session,application,config,pageContext and 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. 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 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