jsp隐式对象_JSP中的隐式对象

jsp隐式对象

JSP中的隐式对象 (Implicit Objects in JSP)

JSP provide access to some implicit object which represent some commonly used objects for servlets that JSP page developers might need to use. For example you can retrieve HTML form parameter data by using request variable, which represent the HttpServletRequest object.

JSP提供对某些隐式对象的访问,这些隐式对象表示JSP页面开发人员可能需要使用的servlet的一些常用对象。 例如,您可以使用代表HttpServletRequest对象的请求变量来检索HTML表单参数数据。

jsp隐式对象_JSP中的隐式对象

以下是JSP隐式对象 (Following are the JSP implicit object)

Implicit Object Description
request The HttpServletRequest object associated with the request.
response The HttpServletRequest object associated with the response that is sent back to the browser.
out The JspWriter object associated with the output stream of the response.
session The HttpSession object associated with the session for the given user of request.
application The ServletContext object for the web application.
config The ServletConfig object associated with the servlet for current JSP page.
pageContext The PageContext object that encapsulates the enviroment of a single request for this current JSP page
page The page variable is equivalent to this variable of Java programming language.
exception The exception object represents the Throwable object that was thrown by some other JSP page.
隐式对象 描述
请求 与请求关联的HttpServletRequest对象。
响应 与发送回浏览器的响应关联的HttpServletRequest对象。
与响应的输出流关联的JspWriter对象。
会议 与给定请求用户的会话相关联的HttpSession对象。
应用 Web应用程序的ServletContext对象。
配置 与当前JSP页面的servlet关联的ServletConfig对象。
pageContext PageContext对象,该对象封装了对此当前JSP页面的单个请求的环境
page变量等效于Java编程语言的变量。
例外 异常对象表示由其他JSP页面引发的Throwable对象。


All of them are very useful and you will slowly get to know all of them as you will move ahead into your career working on live projects. For example: When you will create an application where in User sessions have to be created session will come into picture, request is used when you have form submissions in your application etc.

所有这些都是非常有用的,随着您逐步进入现场项目的职业,您将逐渐了解它们。 例如:当您将创建一个必须在用户会话中创建session的应用程序时, session就会变成图片,当您在应用程序中提交表单时使用request

We will learn about these in details later on.

稍后我们将详细了解这些内容。

翻译自: https://www.studytonight.com/jsp/implicit-object-in-jsp.php

jsp隐式对象