Introduction to JSP Development (IV)--JSP internal objects

Source: Internet
Author: User
Tags object copy client access

The last component associated with the JSP syntax is called an internal object. Within the JSP small instruction file, you can access these internal objects to interact with the servlet environment that performs JSP Web pages. Many of the access to internal objects should be simplified. However, these are examples, their access is acceptable, and the need to fully utilize the internal object settings requires an understanding of the latest Java Servlet APIs.

The following table lists the internal objects you can use.

Internal Object Description

Request client requests that this request contain parameters from the Get/post request

Response Web page Returns the response of the client

The properties of the PageContext Web page are managed here

Session with request-related sessions

What the application servlet is doing

Out the output stream used to transmit the response

Config servlet schema Object

PAGEJSP Web page itself

Exception for error pages, not captured exceptions

So, what do these do, and how do you use them? Basically, in your small instruction file, you can use them to access the servlet that executes the JSP program code. To avoid talking about the details of too many servlet APIs, let's examine some of the things you can do with them:

Instead of using an expression, you can directly access an internal out object to print something to response:

<% out.println ("Hello"); %>.

You do not have to send parameters directly to JavaBean, you can get the value of the parameter by requesting the object:

<% String name=request.getparameter ("name"); OUT.PRINTLN (name); %>.

When you write a lot of apps in JSP, if you build JavaBeans or find yourself putting too many Java primitives into your JSP files, you need to build supported Java classes that encourage reuse and reduce the time it takes to convert JSP pages. When you need to build a Java class, you must:

Add the JDSWK installation directory in directory to your path. At the end of the path to your Autoexec.bat file, join c:1.2.2in.

Copy the jar file to the Jrelibext directory with the following instructions:

Copy C:jswdk-1.0.1libservlet.jar C:jdk1.2.2jrelibext.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.