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:
1. without using the formula, you can directly access the internal out object to print something to response:
<% Out. println ("hello"); %>.
2. you do not need to directly transmit parameters to JavaBean. You can obtain the parameter value by requesting the object:
<% string name = request. getparameter ("name"); out. println (name); %>.
after you write many applications using JSP, If you create a JavaBeans or find that you put too many original Java 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:
1. Add the jdswk installation directory \ bin directory to your path. Add c: \ 1.2.2 \ bin; To the end of path of your autoexec. BAT file ;.
2. the following command copies the JAR file to the \ JRE \ Lib \ ext directory:
copy c: \ jswdk-1.0.1 \ Lib \ servlet. jar c: \ jdk1.2.2 \ JRE \ Lib \ Ext.