This is the help for flex and java integration
On Mon, May 14, 2012 at 8:28 PM, Ramesh Vavila <[email protected]>wrote:
>
> Hi Friends,
>
> I am trying to create andy warhol , water swirl, vignette
> filters . can any one help me its very urgent.if you have any sample code
> please share with me.
>
>
> Thanks
> ramesh v
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Flex India Community" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/flex_india?hl=en.
>
--
Best Regards
Jogani Rakesh
+919662207750
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.
1 Install JDK in your system
2 Copy apache tomcat server in your c drive
3 Set Environment Variable
(1) Variable Name : JAVA_HOME
Variable Value : C:\Program Files\Java\jdk1.7.0
(2) Variable Name : CATALINE_HOME
Variable Value :
C:\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35
4 Update the "Path" Environment Variable in Variable Value
Add tha fillowing Path
(1)C:\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35\bin
(2)C:\Program Files\Java\jdk1.7.0\bin
5 Create a Blazeds folder in webapps folder and extract the blazeds.war
file
Two folder there (1)WEB-INF (2)META-INF
6 Create a folder name example in
C:\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35\webapps\FlexJavaIntegration\WEB-INF\classes
7 Create a Java file in example folder content of java file is below
package example;
import java.util.Date;
public class HelloWorld
{
public HelloWorld()
{
}
public String getHelloWorld(String name,String name1)
{
String result = null;
result = name + " and " + name1;
return result;
}
public String getCurrentDate(String name)
{
String result = null;
result = " Current Date is:" + new Date();
return result;
}
}
8 Complile the .java file in CMD
javac HelloWorld.java
9 Go to folder
C:\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35\webapps\FlexJavaIntegration\WEB-INF\flex
and edit the remoting-config.xml file and add the destination
<destination id="helloworld">
<properties>
<source>example.HelloWorld</source>
</properties>
<adapter ref="java-object" />
</destination>
10 Start Tomcat Server from CMD
Go to bin folder of Tomcat server folder
Run startup.bat file in cmd and start Tomcat server
check: "localhost:8080" URl in your browser
and if you want to shutdown the tomcat serve write follwing command in
CMD
shutdown.bat
11 Create New Flex Application
Select Server Technology - J2EE
12 Click Next and Set Following Properties
Root Folder :
C:\apache-tomcat-6.0.35-windows-x86\apache-tomcat-6.0.35\webapps\blazeds
Root URL : http://localhost:8080/blazeds
Context Root : /blazeds
And Validate Configuration
13 The Remote Object Syntax is as follows
<mx:RemoteObject id="ro" destination="helloworld"
source="example.HelloWorld" result="resultHandler(event)"
fault="faultHandler(event)"/>
---------destination in RemoteObject is id of destination in
remoting-config.xml
---------source in RemoteObject is source of destination in
remoting-config.xml
14 Now Call the Java Method as follows
<mx:Button label="Get Hello World!"
click="ro.getHelloWorld(txt1.text,txt2.text)"/>
<mx:Button label="Get Time" click="ro.getResults(txt1.text)" />
Here ro is id of RemoteObject and getHelloWorld & getResults is
method from JAVA file.
15 You get result from java class file