Please enable JavaScript.
Coggle requires JavaScript to display documents.
JSP (Action (jsp:setProperty (name, param, value, property), jsp:useBean…
JSP
-
Implicit Object
Application
In JSP, application is an implicit object of type ServletContext.The instance of ServletContext is created only once by the web container when application or project is deployed on the server.This object can be used to get initialization parameter from configuaration file (web.xml). It can also be used to get, set or remove attribute from the application scope.
<param-name>dname</param-name> <param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value> in web xml, String driver=application.getInitParameter("dname"); in jsp
Config
In JSP, config is an implicit object of type ServletConfig. This object can be used to get initialization parameter for a particular JSP page. The config object is created by the web container for each jsp page.
<param-name>dname</param-name> <param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value> in web xml, String driver=config.getInitParameter("dname"); in jsp
Session
In JSP, session is an implicit object of type HttpSession.The Java developer can use this object to set,get or remove attribute or to get session information.
session.setAttribute("user",name) in first jsp, String name=(String)session.getAttribute("user"); in second jsp
-
Response
Just as the server creates the request object, it also creates an object to represent the response to the client.
-
page
In JSP, page is an implicit object of type Object class.This object is assigned to the reference of auto generated servlet class. It is written as Object page=this;
-
-
Exception
In JSP, exception is an implicit object of type java.lang.Throwable class. This object can be used to print the exception. But it can only be used in error pages.It is better to learn it after page directive.
-
-
-
-