What is jsp:use bean. What are the scope attributes & difference between these attributes?
The element locates or instantiates a JavaBeans component.
first attempts to locate an instance of the bean. If the bean does not exist, instantiates it from a class or serialized template. The body of a element often contains a element that sets property values in the bean. The body tags are only processed if instantiates the bean. If the bean already exists, the body tags have no effect.
What are Custom tags. Why do you need Custom tags. How do you create Custom tag?
The most recent version of the JSP specification defines a mechanism for extending the current set of JSPtags.
It does this by creating a custom set of tags called a tag library. That is what the taglib points to.
The taglib directive declares that the page uses custom tags, uniquely names the tag library defining them, and associates a tag prefix that will distinguish usage of those tags.
The syntax of the taglibdirective is as follows:
<%@ taglib uri="tagLibraryURI" prefix="tagPrefix" %>
What is the difference between include directive & jsp:include action?
Difference between include directive and
1. provides the benifits of automatic recompliation,smaller class size ,since the code corresponding to the included page is not present in the servlet for every included jsp page and option of specifying the additional request parameter.
2.The also supports the use of request time attributes valus for dynamically specifying included page which directive does not.
3.the include directive can only incorporate contents from a static document.
4. can be used to include dynamically generated output eg. from servlets.
5.include directive offers the option of sharing local variables,better run time efficiency.
6.Because the include directive is processed during translation and compilation,it does not impose any restrictions on output buffering.
What is the difference between servlet session and jsp session?
Nothing, Since a JSP at the end becomes a Servlet. The session handling capabilities are the same for a JSP as well as Servlets.
Why should we setContentType() in servlet ?what is the use of that method?
To intimate the browser that which type of content is coming as response,Depending upon the contentType browser treats with the response.