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

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

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

    隨筆-193  評論-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 閱讀(1808) 評論(0)  編輯  收藏 所屬分類: Java 、Flex & Flash
    主站蜘蛛池模板: 欧美三级在线电影免费| 国产免费拔擦拔擦8x| 91av在线免费视频| 女人18毛片水真多免费看| a级亚洲片精品久久久久久久| 亚洲AV成人无码久久精品老人| 国产精品视_精品国产免费| 亚洲一区日韩高清中文字幕亚洲 | 日韩电影免费在线观看网址 | 无码色偷偷亚洲国内自拍| 99久久免费国产特黄| 一本无码人妻在中文字幕免费| 久久久久久亚洲精品不卡| 亚洲国产成人久久99精品| 一进一出60分钟免费视频| 国产一精品一AV一免费孕妇| 亚洲人成www在线播放| 国产一级片免费看| 亚洲成?v人片天堂网无码| 亚洲无限乱码一二三四区| 国产日韩一区二区三免费高清| 亚洲成人网在线观看| 国产2021精品视频免费播放| 国产成人精品日本亚洲| 一本久久免费视频| 亚洲一级免费毛片| 亚洲国产精品免费观看 | 日韩免费无码视频一区二区三区 | 曰批视频免费40分钟试看天天| 免费国内精品久久久久影院| 91久久亚洲国产成人精品性色| 四虎国产精品成人免费久久| 成人午夜亚洲精品无码网站| 午夜免费啪视频在线观看| 在线亚洲97se亚洲综合在线| 日本免费在线中文字幕| 国产精品亚洲高清一区二区| 精品熟女少妇av免费久久| 亚洲av纯肉无码精品动漫| 亚洲综合久久精品无码色欲 | 在线免费视频一区|