Skip to main content

Posts

Showing posts from May, 2016

JSP tutorial part 9:JSP Directives

JSP Directives JSP Directives: JSP directive elements provide information to JSP container about the page . <%@ directive attribute="value" %> There are three types of directive tags: Directive Description <%@ page ... %> Defines page-dependent attributes, such as scripting language, error page, and buffering requirements. <%@ include ... %> Includes a file during the translation phase. <%@ taglib... %> Declares a tag library, containing custom actions, used in the page JSP page directive: Gives high-level information about the servlet that will result from the JSP page. Can control: –Which classes are imported? –What class the servlet extends –What MIME type is generated? –How multithreading is handled –If the servlet participates in sessions –The size and behavior of the output buffer –What page handles unexpected errors? The page dir

JSP Tutorial part :8 JSP implicit objects

JSP implicit objects JSP supports nine automatically defined variables,which are also called implicit objects. Objects Description Request This is HttpServletRequestobject associated with the request. Request objects are passed as parameters to jspService() method when a client request is made. Response This is HttpServletResponseobject associated with the response to the client. Response objects carry the response of a client request after the jspService() method is executed. Out This is PrintWriter object used to send output to the client. session This isHttpSessionobject associated with the request. The session object helps access session data . application The application object refers to the entire environment of a web application to which a JSP page belongs. The ServletContext(for sharing data) as obtained via getServletContext().