The internal object of CNET JSP basic:jsp

Source: Internet
Author: User
Tags copy client
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. These are examples, however, where access is acceptable, and the full use of internal object settings is an understanding of the latest Java Servlet APIs.
The following table lists the internal objects you can use.

Internal Object Description
Request client, this request contains 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 call period
What the application servlet is doing
Out output stream used to transmit the response
Config servlet schema Object
Page JSP pages themselves
Exception for error pages, not captured exceptions


So, what do these do, and how do you use them? Basically, in your small command file, you can use them to access the servlet that executes the JSP 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 a formula, 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 a JavaBeans or find yourself putting too many Java primitives into your JSP files, you need to build a Java class that supports it, which encourages reuse and reduces the time it takes to convert JSP pages. When you want to build a Java class, you must:
Add the JDSWK installation directory \ Bin directory to your path. At the end of the path to your Autoexec.bat file, join C:\1.2.2\bin.
Copy the jar file to the \jre\lib\ext directory with the following instructions:
Copy C:\jswdk-1.0.1\lib\servlet.jar C:\jdk1.2.2\jre\lib\ext.



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.