Cnet jsp basic: Internal JSP object

Source: Internet
Author: User

The last element related to JSP syntax is an internal object. In a small JSP instruction file, you can access these internal objects to interact with the servlet environment that executes JSP pages. Access to many internal objects should be simplified. However, these are examples, and their access is acceptable. To fully utilize internal object settings, you need to understand the latest Java Servlet API.
The following table lists the internal objects you can use.

Description of internal objects
Request client request, which contains parameters from the GET/POST request
Response returned from the response webpage to the client
The pageContext page is managed here.
Session-related call Period
Content being executed by application servlet
Output Data Stream used to send response
Config servlet architecture object
Page JSP page itself
Exception for the error webpage, exceptions not captured


Which of the following is what we do, and how do you use them? Basically, in your small instruction files, you can use them to access servlets that execute JSP code. To avoid talking about too many details about Servlet APIs, let's examine what you can do with them:

Without using the formula, you can directly access the internal out object to print something to response:
<% Out. println ("Hello"); %>.
You do not need to directly transmit parameters to JavaBean. You can obtain the parameter values by requesting the object:
<% String name = request. getParameter ("name"); out. println (name); %>.
After you write a lot of applications using JSP, If you create a JavaBeans or find that you put too many Java original codes into your JSP file, create a supported Java category to encourage repeated use and reduce the time required for JSP page conversion. To create a Java class, you must:
Add the in directory of the JDSWK installation directory to your PATH. Add C: 1.2.2in; To the end of PATH of your autoexec. bat file ;.
Run the following command to copy the JAR file to the jrelibext directory:
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.