JSP development entry (3) ---- JSP and Javabean

zhaozj2021-02-08  237

Although you can put a large block of program code in a small instruction file, most Java program code is a component that can be reused, called JavaBean. JavaBean is the same as the ActiveX control: they provide known functions and designed to reuse the purpose of repeated use. The value of JavaBean is that it can be used via a set of features, and these features provide access to JavaBean settings. People who come to people, this person is Javabean, and his name, social welfare security number, and address can be characteristic. For JSP websites, basically you are connecting 'JavaBean' dynamic connecting to your website. Suppose Javabean is built before building a website. The first thing you have to do is to tell the JSP web page it needs to use JavaBean. This work can be done with volume: . Volume Script requires you to identify beans in id attribute. Here, you provide a name to let JSP web pages identify beans, except Outside the ID attribute, you must also tell the webpage to find this bean, or its Java category name. Category Properties provide how to find it in a variety of methods, the last needed component is a scope property. With the help of the range properties, you can tell the beans, you want it to be a single web page (preset) [Scope = "Page"] For a request page [scope = "request"]; for the call period [scope = "session"]; or for the entire application [Scope = "Application"] to maintain its own information. For the scope of the call, You can easily maintain items in the JSP page, such as shopping carts. Once you declare javabean, you can access its characteristics to set it. To get a value of a feature, use the volume. With the volume, you can specify the beans name (from the usebean ID field), and the feature you want to get.

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

New Post(0)