Viewing Flash Remoting log entries
141
flashtestService.testDocument(xmlDocument);
}
Note:
You can also create an XML document object in ActionScript by passing a string
representation of the XML to the
new XML(source)
constructor. For more information, see the Flash
documentation set.
Returning an XML object from Java to Flash
The JavaBean method discussed in the previous section returns an org.w3c.dom.Document
object as follows:
public Document testDocument(Document doc)
{
return doc;
}
Flash Remoting converts the returned org.w3c.doc.Document object to an ActionScript result of
type XML object, which can be used in a result handler function as follows:
function testDocument_Result(result:ResultEvent):Void
{
output.text = result.firstChild.attributes["message"];
}
When the function above is called, the text contained in the first child element of the XML
document root is displayed in a Flash dynamic text field called
output
. The text matches
whatever text the user initially entered in the Flash text field called
input
.
Viewing Flash Remoting log entries
Flash Remoting writes messages to standard out and standard error, which appear in the following
log files:
Flash Remoting uses a default logger on all Java application servers other than JRun. You can set
the default logger’s log level using the
LOG_LEVEL
context-parameter in the web.xml file of the
Flash Remoting web application. Valid values are None, Error, Warning, Information, and
Debug. By default, only errors are logged. The values are not case sensitive.
Application server
Log location
Sun One Web Server
error file in the sunone_root/Servers/https-server_name/logs directory
WebSphere
servername_stdout and servername_stderr files in the websphere_root/
AppServer/logs directory
JRun
servername_event files in jrun_root/logs directory