HTML/CSS Service

Showcase

1 comment0 views
1 Star2 Stars

Invoking Java methods from Adobe Flex

Category: Flex Examples, Learn Flex    |    4,050 views    |    1 Comment

 

How to invoke Java methods from Flex application?

  1. Add an mapping to the Java class to services-config.xml
  2. Map your RemoteObject (provided with Flex SDK) on the client side to the destination configured in services-config.xml
  3. Invoke the method in your Java class using the RemoteObject instance

What do you need to invoke a Java method from the client side application?

  1. Flex Builder
  2. Blaze DS

Isn’t that simple? Let’s get into details of implementing this.

Set up Blaze DS

Download and setup Blaze DS on your system fromhttp://labs.adobe.com/technologies/blazeds/

You will be downloading Blaze DS with integrated Tomcat server. You just have to start the server by executing startup.bat under tomcat/bin. Please note the port number in which the Tomcat server is running. The port number mentioned below might have to be replaced with yours, if required. Read more…

Share/Save/Bookmark

 

Getting URL Parameters in Flex Actionscript

Category: Flex Examples, flex tutorials    |    3,717 views    |    2 Comments

Get the full url with the host name and port in actionscript?

There are several methods to help with this:

getHostName()
getPort()
getProtocol() -such as http or https
getContext() -The path after the hostname but before the url parameters

Share/Save/Bookmark

 

Exception Handling with Flex

Category: Flex Examples, flex tutorials    |    16,971 views    |    2 Comments

A common hurdle a developer may face is dealing with exceptions in BlazeDS. When an exception is thrown in Java, how do we handle this in flex? Here is a simple and flexible approach inspired by Scott Morgan.

1. Create a Java Class that extends RuntimeException.

package com.flexpasta.exception;
public class FlexException extends RuntimeException
{
public FlexException(String message)
{
super(message);
}
}

Read more…

Share/Save/Bookmark