JavaBean skills

zhaozj2021-02-17  91

JavaBean skills

Author: Speaking: Finishing:

Jsper

Although you can put the code of the big section on the script fragment (

Scriptlet

Inside, the vast majority

Java

The code belongs to reused names

Javabea

s component.

Javabean

Similar

ActiveX

Controls: They all provide common functions and can be reused.

The value of JavaBean is obtained through some properties, and you can access JavaBean settings through these properties. With one person, this person is a JavaBean, the name, ID number, and address of this person are its properties. In the JSP website, you basically make your website dynamize by playing "Connect The Beans".

Suppose JavaBean is created first, the first thing you need to do is to tell the JSP page that it will use a "bean". You can use the "" tag to do this: ".

"" tag requires that you identify beans with the "ID" property. Here you offer a name that name to the rest of the JSP page. In addition to the "ID" attribute, you must also tell where to find bean, or what is its Java category name. This type of category provides the ability to confirm the Bean, and some other methods can also do this. The last required element is "scope" attribute. With the help of the "Scope" property, you can tell bean as a single page (default) [scope = "page"], for [Scope = "request"] request as a session [Scope = "session", or for "SCOPE =" session " The entire application [scope = "application"] keeps the information. With the scope of the session, you can easily maintain items such as shopping carts on the JSP web page.

Once you have a Javabean, you can access its properties to customize it. To get attribute values, use the "" tag. With this tag, you can specify the bean name that will be used (from the "ID" field of UseBean) and the properties you want to get the value. The actual value is placed in the output: .

To change the JavaBean property, you must use the tag. For this tag, you need to identify beans and properties again to modify and provide additional new values. If naming is correct, these values ​​can be obtained directly from a submitted table: parameter get:

Can be obtained from a parameter, but you must naming properties directly and parameters:

Or use a name and value directly: />. About JavaBean's last thing: for the web server to find Javabean You need to put its category file in a special location. With jswdk, the most convenient location is the category directory in the installation directory, such as /jswdk-1.0.1/classes.

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

New Post(0)