Fill in the blanks:
- The encoding mechanism used for Chinese characters in JSP files is ISO8859-1 .
- The default port of Tomcat server is 8080 .
- Using JSP to establish a connection with a DBMS can be divided into two steps: loading the driver and establishing a connection .
- Among the JSP built-in objects, the object related to the request is Request .
- There are usually two ways for the client to submit data to the server: one is the Get submission method; the other is the Post submission method.
- JSP files are eventually converted into servlet (or bytecode) files.
- The method used in the Out object to output various types of data and wrap new lines is the println() method .
- In JSP, when a query operation is performed, the query results are generally saved in the ResultSet object.
- For exception handling, three types of code can be included in the code segment of the method: try and catch
and finally code block.
- In the JSP specification, two formats of comments can be used: one is output comments ; the other is hidden comments .
- The DatabaseMetaData interface is mainly used to obtain information about the database, while the ResultMetaData class is used to obtain the structure of the database table.
- The full English name of JSP is Java Server Page .
- 11. In JSP, you can use the <jsp:SetProperty> operation to set the properties of the Bean, and you can also use the <jsp:GetProperty> operation to get the value of the Bean.
short answer questions
- Briefly describe the establishment of JSP development environment
- Download and install JDK
- Configure environment variables.
- Download and install TomCat.
- To create a WEB application in the TomCat server, the steps are as follows:
- Enter the webapps directory of TomCat's installation directory, and you can see Tomcat's own directories such as ROOT, examples, and tomcat-docs;
- Create a new directory under the webapps directory and name it myapp;
- Create a new directory WEB_INF under myapp. Note that the directory name is case-sensitive;
- Create a new web.xml under WEB-INF; the content in web.xml can be copied from the corresponding file in the Root directory.
- Write a JSP file first.jsp.
- Copy the file to the myapp folder;
- Start TomCat.
- Enter http://127.0.0.1:80808/myapp/first.jsp in the browser to run the program.
- Which files need to be configured in to configure the Servlet filter, and what tags need to be configured?
Programming questions:
P147 Example 8-6
2. Write a JSP page to calculate the area of the triangle, enter the three sides of the triangle, and click the "Submit" button to get the area.