MACROMEDIA FLEX 2-MIGRATING APPLICATIONS TO FLEX 2 Uživatelský manuál Strana 138

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 184
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 137
138 Data Services
The syntax for statefulness has changed. In Flex 1.5, you set the type to either stateless-
class
or stateful-class. In Flex 2, you set the scope attribute to application, session,
or
request. The default was stateless-class, and is now request, which is equivalent to
stateless.
Flex 1.5 syntax
In Flex 1.5, you could specify the RemoteObject component’s source and type in the MXML
tag, while adding an entry in the
<remote-objects> whitelist.
MXML tag:
<mx:RemoteObject id="MyService" source="credit.CreditCardAuth"
type="stateless-class"/>
flex-config.xml file:
<remote-objects>
<whitelist>
<unnamed>
<source>credit.*</source>
</unnamed>
</whitelist>
</remote-objects>
Flex 2 syntax
In Flex 2, every remote object must be configured as a Remoting Service destination in the
services-config.xml file, or a file that it includes by reference, such as the remoting-config.xml
file. You reference a destination in the
destination property of the <mx:RemoteObject> tag.
MXML tag:
<mx:RemoteObject id="MyService" destination="SalaryEmployeeRO"/>
remoting-config.xml file:
<remoting-service>
<destination id="SampleEmployeeRO" adapter="java-object">
<properties>
<source>samples.explorer.EmployeeManager</source>
<scope>application</scope>
</properties>
</destination>
</remoting-service>
Zobrazit stránku 137
1 2 ... 133 134 135 136 137 138 139 140 141 142 143 ... 183 184

Komentáře k této Příručce

Žádné komentáře