Wednesday, September 26, 2007

JSP Implicit Objects

These are Jsp system defined objects. We no need to create these objects to access them.

1. out
out.println("mahesh");

2. request
request.getParameter("abc");
request.getSession();
etc

3. response
response.getWriter();

4. session
session.isNew();
session.getAttribute("abc");
session.setAttribute("abc",123);
session.removeAttribute("abc");
session.getAttributeNames();
session.getServletContext(();
session.invalidate();

5. pageContext
pageContext.getServletContext();
pageContext.getServletConfig();
pageContext.getSession();
pageContext.getRequest();
pageContext.getResponse();
pageContext.getAttribute("abc");
pageContext.setAttribute("abc",123);
6. page

7. config
config.getServletContext();
config.getInitParameter("abc");
config.getInitParameterNames();
config.getServletName();

8.application
application.getInitParameter("abc"); //here this refers to context parameters becoz this is application.
application.getInitParameterNames();
application.getAttribute("abc");
application.setAttribute("abc",123);
application.removeAttribute("abc");
application.getRequestDispatcher(String path);