<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 閱讀(1816) 評論(0)  編輯  收藏 所屬分類: JavaFlex & Flash
    主站蜘蛛池模板: 无码av免费毛片一区二区| 国产精品亚洲lv粉色| 久久国产免费直播| 亚洲毛片不卡av在线播放一区| 国产精品亚洲自在线播放页码 | 亚洲精品国产精品乱码不卡| 狠狠热精品免费观看| 免费国产精品视频| 污污视频网站免费观看| 亚洲精品国产高清嫩草影院 | 亚洲美女中文字幕| 日韩精品人妻系列无码专区免费| 久久精品亚洲视频| 亚洲视频免费在线观看| 亚洲午夜精品一区二区公牛电影院 | 在线免费观看中文字幕| 在线观看国产一区亚洲bd| 国产一级理论免费版| 精品国产免费一区二区三区| 国产亚洲一区二区手机在线观看| 久久精品成人免费网站| 亚洲免费一级视频| 日本免费高清一本视频| kk4kk免费视频毛片| 久久精品亚洲综合| 69成人免费视频无码专区| 日本亚洲中午字幕乱码| 在线亚洲午夜理论AV大片| 最近2019免费中文字幕6| 亚洲熟女综合一区二区三区| 亚洲高清无码在线观看| 免费国产在线视频| 亚洲色大成网站www| 亚洲日韩涩涩成人午夜私人影院| 无码人妻精品中文字幕免费| 亚洲色偷精品一区二区三区| 亚洲日韩在线中文字幕第一页| 99在线视频免费| 精品亚洲国产成人av| 精品久久香蕉国产线看观看亚洲| 99久久99这里只有免费费精品|