JSP development entry (4) ---- JSP internal object

zhaozj2021-02-08  220

Keywords: Java

The last component related to the JSP syntax is called internal objects. In the JSP small instruction file, you can access these internal objects to interact with the servlet environment that performs the JSP page. Many access to internal objects should be simplified. However, these are examples, and their access is acceptable, and the complete use of internal object settings requires aware of the latest Java Servlet API. The following table lists the internal objects you can use. Internal object description Request client request, this request will contain the parameter page of the Get / POST request to return to the client's response to the attribute of the pageContext page is here to manage the session and request information related session Application Servlet is executing OUT for transmitting Response Output CONFIG Servlet's Architecture Objects Page JSP Page Bible EXCEPTION For the error web page, unconcerned exceptions, how do you use them? Basically, in your small instruction file, you They can use them to access servlets that perform JSP program code. In order to avoid talking to the details of too many servlet APIs, let's see some things you can do with them: You don't have to use expressions, you can directly access the internal OUT objects to print some things to Response: <% out.println ("Hello");%>. You don't have to transfer parameters directly to JavaBean, you can get the value of the parameters by requesting the object: <% string name = request.getParameter ("name"); out.println (name);% ". When you write a lot of applications with JSP, if you have established JavaBeans or discovers that you will put too much Java original code into your JSP file, you need to establish a supported Java category, which can encourage reusing and decrease The time required for JSP web page conversion. When you need to build a Java category, you must: add the JDSWK installation directory / bin directory to your Path. At the end of your autoexec.bat file, the final, add C: / 1.2.2/bin; Copy the JAR file to the / jRE / lib / ext directory: Copy C: /jswdk-1.0.1/lib/servet.jar c: /jdk1.2.2/jre/lib/ext.

转载请注明原文地址:https://www.9cbs.com/read-2084.html

New Post(0)