<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-193  評(píng)論-715  文章-1  trackbacks-0

    Build client-side application notes:
    1, Specifying the services-config.xml file in a compilation
    When you compile your Flex application, you typically specify the services-config.xml configuration file to the compiler. This file defines the channel URLs that the client-side Flex application uses to communicate with the BlazeDS server. Then the channel URLs are compiled into the resultant SWF file.
    Both client-side and server-side code use the services-config.xml configuration file. If you change anything in services-config.xml, you usually have to recompile your client-side applications and restart your server-side application for the changes to take effect.
    In Flex Builder, the appropriate services-config.xml file is included automatically based on the BlazeDS web application that you specified in the configuration of your Flex Builder project. When you use the mxmlc compiler, use the  services  option to specify the location of the file.
    Note: You can also create channel definitions at run time in ActionScript. In that case, you might be able to omit the reference to the services-config.xml configuration file from the compiler.
    2, Specifying the context root in a compilation
    The services-config.xml configuration file typically uses the  context.root  token to specify the context root of a
    web application. At compile time, you use the compiler  context-root  option to specify that information.
    During a compilation, Flex Builder automatically sets the value of the  context.root  token based on the BlazeDS
    web application that you specified in the configuration of your project. When you use the mxmlc compiler, use the
    context-root  option to set it.

     
    How to create a Flash Builder project?
    Use this procedure to create a Flex Builder project to edit one of the samples shipped with the Test Drive application.
    The procedure for creating and configuring a new project is almost the same as the following procedure.
    1     Start Flex Builder.
    2     Select File > New > Flex Project.
    3     Enter a project name. You are editing an existing application, so use the exact name of the sample folder:
    testdrive-chat.
    Note: If you are creating an empty project, you can name it anything that you want.
    4     If you unzipped flex-src.zip in the samples directory, deselect the Use Default Location option, and specify the directory as C:\blazeds\tomcat\webapps\samples\testdrive-chat, or wherever you unzipped the file on your computer.
    Note: By default, Flex Builder creates the project directory based on the project name and operating system. For example, if you are using the plug-in configuration of Flex Builder on Microsoft Windows, the default project directory is C:\Documents and Settings\USER_NAME\workspace\PROJECT_NAME.
    5     Select the application type as Web application (runs in Flash Player) to configure the application to run in the browser as a Flash Player pplication.
    If you are creating an AIR application, select Desktop Application (Runs In Adobe AIR). However, make sure that you do not have any server tokens in URLs in the configuration files. In the web application that ships with BlazeDS, server tokens are used in the channel endpoint URLs in the WEB-INF/flex/services-config.xml file, as the following example shows:
    <endpoint
    url="https://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf"
          class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
    You would change that line to the following:
    <endpoint url="http://your_server_name:8400/samples/messagebroker/streamingamf"
          class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
    6     Select J2EE as the Application server type.
    7     Select Use Remote Object Access.
    8     Select LiveCycle Data Services.
    9     If the option is available, deselect Create Combined Java/Flex Project With WTP.
    10  Click Next.
    11  Deselect Use Default Location For Local LiveCycle Data Services Server.
    12  Set the root folder, root URL, and context root of your web application.
    The root folder specifies the top-level directory of the web application (the directory that contains the WEB-INF directory). The root URL specifies the URL of the web application, and the context root specifies the root of the web application.
    13  Make sure that your BlazeDS server is running, and click Validate Configuration to ensure that your project is valid.
    14  Verify that the Compile The Application Locally In Flex Builder option is selected.
    15  Clear the Output Folder field to set the directory of the compiled SWF file to the main project directory.
    By default, Flex Builder writes the compiled SWF file to the bin-debug directory under the main project directory. To use a different output directory, specify it in the Output Folder field.
    16  Click Next.
    17  Set the name of the main application file to Chat.mxml, and click Finish.

     

     Client-side logging
    For client-side logging, you directly write messages to the log file, or configure the application to write messages generated by Flex to the log file. Flash Debug Player has two primary methods of writing messages to a log file:
    ?     The global  trace()  method. The global trace() method prints a String to the log file. Messages can contain checkpoint information to signal that your application reached a specific line of code, or the value of a variable.
    ?     Logging API. The logging API, implemented by the TraceTarget class, provides a layer of functionality on top of the  trace()  method. For example, you can use the logging API to log debug, error, and warning messages generated by Flex while applications execute.
    Flash Debug Player sends logging information to the flashlog.txt file. The operating system determines the location of this file, as the following table shows:
    Use settings in the mm.cfg text file to configure Flash Debug Player for logging. If this file does not exist, you can create it when you first configure Flash Debug Player. The location of this file depends on your operating system.
    The following table shows where to create the mm.cfg file for several operating systems:
    The mm.cfg file contains many settings that you can use to control logging. The following sample mm.cfg file enables error reporting and trace logging:
    ErrorReportingEnable=1
    TraceOutputFileEnable=1
    After you enable reporting and logging, call the  trace()  method to write a String to the flashlog.txt file, as the
    following example shows:
    trace("Got to checkpoint 1.");
    Insert the following MXML line to enable the logging of all Flex-generated debug messages to flashlog.txt:
    <mx:TraceTarget loglevel="2"/>

    Server-side logging
    You configure server-side logging in the logging section of the services configuration file, services-config.xml. By default, output is sent to System.out.
    You set the logging level to one of the following available levels:
    ?     All
    ?     Debug
    ?     Info
    ?     Warn
    ?     Error
    ?     None
    You typically set the server-side logging level to  Debug  to log all debug messages, and also all info, warning, and error messages. The following example shows a logging configuration that uses the  Debug  logging level:
    <logging>
    <!-- You may also use flex.messaging.log.ServletLogTarget. -->
    <target class="flex.messaging.log.ConsoleTarget" level="Debug">
    <properties>
    <prefix>[Flex]</prefix>
    <includeDate>false</includeDate>
    <includeTime>false</includeTime>
    <includeLevel>false</includeLevel>
    <includeCategory>false</includeCategory>
    </properties>
    <filters>
    <pattern>Endpoint</pattern>
    <!--<pattern>Service.*</pattern>-->
    <!--<pattern>Message.*</pattern>-->
    </filters>
    </target>
    </logging>

     

     

    You use two parameters in a channel definition to enable message processing metrics:
         <record-message-times> 
         <record-message-sizes> 
    Set these parameters to  true  or  false ; the default value is  false . You can set the parameters to different values to capture only one type of metric. For example, the following channel definition specifies to capture message timing
    information, but not message sizing information:
    <channel-definition id="my-streaming-amf"
    class="mx.messaging.channels.StreamingAMFChannel">
    <endpoint
    url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf"
    class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
     <properties>
      <record-message-times>true</record-message-times>
      <record-message-sizes>false</record-message-sizes>
     </properties>
    </channel-definition>

    posted on 2010-04-01 22:31 Robin's Programming World 閱讀(1816) 評(píng)論(0)  編輯  收藏 所屬分類: JavaFlex & Flash
    主站蜘蛛池模板: 亚洲妓女综合网99| 亚洲综合色区在线观看| 亚洲最大中文字幕| 99爱在线精品视频免费观看9| 亚洲色欲久久久综合网| 一级做α爱过程免费视频| 亚洲国产日韩在线观频| 暖暖免费中文在线日本| 久久久久久亚洲精品不卡| 国产久爱免费精品视频 | 日韩一区二区三区免费体验| 亚洲狠狠狠一区二区三区| 亚洲精品在线免费观看视频| 亚洲毛片免费观看| 女人18特级一级毛片免费视频| 亚洲中文字幕无码久久2020| 国产成人青青热久免费精品| 免费人成视频在线观看免费| 亚洲色自偷自拍另类小说| 精品无码AV无码免费专区| 亚洲永久在线观看| 免费日本黄色网址| 国产在线精品一区免费香蕉 | 亚洲欧洲日产国产综合网| 57pao一国产成视频永久免费| 亚洲人成777在线播放| 成人免费无遮挡无码黄漫视频| 亚洲爆乳AAA无码专区| 久久精品国产亚洲精品| 最好看最新的中文字幕免费| 亚洲熟女精品中文字幕| 亚洲v国产v天堂a无码久久| 久久国产免费一区二区三区| 亚洲制服丝袜第一页| 亚洲国产中文v高清在线观看| 免费无码一区二区三区蜜桃| 久久狠狠爱亚洲综合影院| 免费大黄网站在线看| 亚洲免费精彩视频在线观看| 亚洲欧美日韩久久精品| 亚洲av永久无码精品表情包|