Flex1.5 study notes 1

xiaoxiao2021-03-05  24

For Flex's learning personal feelings mainly in two aspects, one is the Flex rich tag library, can easily construct a rich user interface; on the other hand, it is to learn how Flex as a web app's performance layer and multi-layer applications Other grassroots are communicating.

Flex Call JavaBean in Server JVM is initially:

Background: Flex can use Data Service with three ways: First, the refict service, the third is http service, the web service only knows the approximate, no deployment, HTTP Service feels in a general three-layer application There are not many, just study Remote Object Service. Remote Object Service is white, which is the interaction of Flex and server-side General Java objects, which may be Pojo (Plain Old Java Object) or JavaBean et al. Any object that is not deployed as a Web Service.

Tag: Use Remote Java Object in Flex to identify the REMOTEOBJECT to be used to identify the REMOTEOBJECT to be divided into two types, named and unnamed, the difference between the two distinguishment is If there is NAMED (this is used to tell Flex to call the Java object which class is this property, this RemoteObject is named. And if there is no named property, you must be like Source attributes (Source = package.classname This class is in the classpath found under the classpath you can find if you are using What is Tomcat This classpath is the ../web-inf/classes directory). These two uses are not very clear in the use of essentials, they will not be studying first.

Call: The communication of Flex and Java Object is to call the Java object, which involves how the parameters are transmitted. There are two ways to transfer the function transfer parameters of the Java object in Flex: 1. Explicit parameter passes is to write the parameter list of the function like usually written Java code, see an example: dataSourceExample defined course of this class is: public class dataSourceExample {private String msg; public void setMsg (String msg) {this.msg = msg; show ();} public String getMsg () {return msg;} public Void show () {system.out.println (msg);}}

The last step: This is written, it is running, but there is still a point to configure the following, it is necessary to configure the flex-config.xml in the ../web-inf/flex configuration ....... Samples. * Samples * < / source>

WE STRONGLY Recommend NOT ALOWING Access To All Source Files in Production, Since this Exposes Java and flex system classes. * ->

Samples.Explorer.employeemanager stateful-class True I just said that there is no named property in this RemoteObject, then this is unnamed RemoteObject So in Remote- UnnaMed under WhiteList under Objects Add a * to enable all Classs under the classes to be accessed.

Run: After entering the input box, click OK to see the MSG that came from the Tomcat terminal is output.

Another type of parameter: In addition to the above explicit-centers, it is also possible to use the argument binding method: RemoteObject tag on the above MXML code to be changed: {msg.text} code Means, although it is explained, the Click event of the place button of the call method is changed to: click = "data.setmsg.send ()" send method One called parameter is passed to the setmsg method.

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

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.036, SQL: 9