A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Extending the Flash Com Server with a Java class without using ColdFusionMX etc?

  1. #1
    Junior Member
    Join Date
    Jun 2000
    Posts
    25

    Extending the Flash Com Server with a Java class without using ColdFusionMX etc?

    Hi,

    I was playing around with the Communication Server MX and found it looks usable for two projects we're going to start. The only thing I miss is authentification. So I was looking for an easy way to reuse a Java Class I wrote for our Java socket server that just checks on connect if the user supplied name/pass combination is correct.

    Is it possible to extend the Communication Server with a Javaclass or do you need to buy, install and maintain a ColdFusionMX Installation or a similar overkill when it comes to the needed functionality (starting a class)?

    If there's a way to include/run Java classes in ComServer environment... would anyone be able to point me to some resource? I've been searching a lot but found absolutely nothing yet.

    Thanks,

    maltek
    http://flashcandy.org
    Flash News and Resources
    undocumented Flash MX

  2. #2
    Danny Gomez Creations ® cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    Hi
    The only way that I have found to communicate to java from flash (without remoting/cf) is as javabeans with JSP.
    Make 2 LoadVars objects in flash, and append the login info...
    ...untested code example:
    Code:
    //----flash----
    
    fconnect_nc=new NetConnection();
    fconnect_nc.onStatus=function(info){
    //init maltek flashcom stuff
    }
    checkJpass= new LoadVars();
    checkReturned=new LoadVars();
    checkJpass.username=_root.username_txt.text;
    checkJpass.password=_root.password_txt.text;
    checkJpass.sendAndLoad(checkLogin.jsp,checkReturned);
    checkReturned.onLoad=function(){
    if(checkReturned.passed=="yes"){
    _root.fconnect_nc.connect("yourserver/app/",_root.checkJpass.username);
    }
    }
    
    //checkLogin.jsp
    
    < % @ page import="java.sql.*" % >
    //instance of your class ("DBConnect.java"?, hehe)
    < jsp:useBean class="maltekPackage.DBConnect" id="jClass" scope="request"  / >
    < %
    String username,password;
    username=request.getParameter("username");
    password=request.getParameter("password");
    
    //checkLoginData a boolean method 
    if(jClass.checkLoginData(username,password)){
    out.print("&passed=yes&");
    }else{
    out.print("&passed=no&");
    }
    % >
    hmm...looks prommesing, I would test this if I had the time...
    Last edited by cosmiceye; 01-15-2003 at 08:33 PM.
    ..:: P S Y T O P I A 2 0 0 5 :::..
    . . . view the psytopia reels _____RIVEND REEL | GOMEZ REEL_____ . . . . . . . . . . .

  3. #3
    Junior Member
    Join Date
    Jun 2000
    Posts
    25
    There's no server sided LoadVar's object as far as I know. What you describe is a method to send data from the Flashmovie directly to the backend, right? I am looking for a way to server side authenificate users. It's to insecure to let the authenfication for the comm server app run over the front end.

    Regards,

    maltek
    http://flashcandy.org
    Flash News and Resources
    undocumented Flash MX

  4. #4
    Danny Gomez Creations ® cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    what are you talking about? flash sends the name and password from front-end textboxes, to the backend jsp. The backend jsp sends it over to your backend javaclass. The javaclass returns yes or no back to flash and flash connects to the backend commserver with the username if it passed the backend javaclass check.

    Are you meaning that you want the javaclass to directly talk with the commserver, and make the connection outside the flash client? Without any other mx server programs?
    ..:: P S Y T O P I A 2 0 0 5 :::..
    . . . view the psytopia reels _____RIVEND REEL | GOMEZ REEL_____ . . . . . . . . . . .

  5. #5
    Danny Gomez Creations ® cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982

    oh try this

    protected JavaCommserver () extends flashcom.exe{
    //code
    }
    ..:: P S Y T O P I A 2 0 0 5 :::..
    . . . view the psytopia reels _____RIVEND REEL | GOMEZ REEL_____ . . . . . . . . . . .

  6. #6
    Junior Member
    Join Date
    Jun 2000
    Posts
    25
    Originally posted by cosmiceye
    Are you meaning that you want the javaclass to directly talk with the commserver, and make the connection outside the flash client? Without any other mx server programs?
    Exactly (=
    http://flashcandy.org
    Flash News and Resources
    undocumented Flash MX

  7. #7
    Danny Gomez Creations ® cosmiceye's Avatar
    Join Date
    Mar 2002
    Location
    under a palmtree in Jamaica waiting for psytopia 2005 to begin
    Posts
    982
    wow. What kind of business r u in, for that kind of security. Hope that its no illegal media material that u need to transfer.

    Well there is a lot of serverside actionscript when workin with flashcomm. And if you can use such things as the LoadVars object to communicate with serverside languages from the frontend, then it should really make sense to have a similar option from the backend actionscript (filename.asc). Yeah, it doesnt sounds stupid at all, now that I open my backend eyes a little wider (no, not the eyes in my arse, harhar). The frontend should really just be about the user interface, so why waste bandwith to transmit data between the user and the server.
    Anyways u need to make the Netconnection object in the frontend, aswell as the other objects. But the netconnection should only be ACCEPTED when the user data provided at the backend pass the javaClass test.
    What I suggest is to surch for tutorials about flashcom/java, and dont mind it being throu remoting or coldfusion. As long as it can be run on Jrun, then you know that its a java platform. And java is kind of flexible, so it shouldnt be impossible to write your own java classes that does what remoting would do for your purpose only.
    ..:: P S Y T O P I A 2 0 0 5 :::..
    . . . view the psytopia reels _____RIVEND REEL | GOMEZ REEL_____ . . . . . . . . . . .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center