Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 09-27-2008, 01:12 PM   #1
kotime42
Registered User
 
Join Date: Aug 2008
Location: Shanghai,China
Posts: 24
Default Flash remoting to Java Servlet

Q:How to use actionscript3.0's NetConnection class to send a request to servlet? How as and Java mapping in params?

And...my trying result is: throw "Call.BadVersion" in client-side. Seems to be params convert problem. Detailed speaking, Servlet's doGet function's params concludes a HttpServletRequest type. And when my actionscript call doGet function, how can I send params to servlet? Are there any conventional data mappings?

Waiting for answers, thx.
kotime42 is offline   Reply With Quote
Old 09-28-2008, 02:54 AM   #2
kotime42
Registered User
 
Join Date: Aug 2008
Location: Shanghai,China
Posts: 24
Question Flash remoting issue to Servlet

Hi, there, my situation is :

I'm trying to use flash.net.NetConnection to send a request and receive a response to a Java Servlet. And the connection seems to be alright, but throws "Call.BadVersion" which I think the problem is on wrong typecasting and lack of extra lib for J2EE gateway for flash remoting.

My server-side code:

web.xml
HTML Code:
<servlet>
    <description/>
    <display-name>FlashGatewayHandler</display-name>
    <servlet-name>FlashGatewayHandler</servlet-name>
    <servlet-class>com.web.FlashGatewayHandler</servlet-class>
</servlet>
...
<servlet-mapping>
    <servlet-name>FlashGatewayHandler</servlet-name>
    <url-pattern>/gateway</url-pattern>
</servlet-mapping>
FlashGatewayHandler.java
Code:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {...}
client-side:
FlashRemotingTest.as
ActionScript Code:
conn = new NetConnection();      conn.addEventListener(NetStatusEvent.NET_STATUS,            function(e:NetStatusEvent):void {      trace("Code:"+e.info.code);      trace("Description:"+e.info.description);      trace("Details:"+e.info.details);      ...     conn.addEventListener(SecurityErrorEvent.SECURITY_ERROR,         function(e:SecurityErrorEvent):void {             trace("SecurityErrorEvent:"+e.text);         });     var url:String = "http://localhost:9080/gateway";     conn.connect(url); //  var responder:Responder = new Responder(onResult, onError);     var servletCall:String = "com.web.FlashGatewayHandler";     conn.objectEncoding = flash.net.ObjectEncoding.AMF3;     conn.client = this;     conn.call(servletCall, null, "param1");

Waiting for solutions...
kotime42 is offline   Reply With Quote
Old 09-28-2008, 05:39 AM   #3
bowljoman
Senior Member
 
Join Date: Jan 2008
Posts: 831
Default

Use the red5 amf gateway servlet .

add this to the web-xml file of your red5 app

Code:
	<servlet>
		<servlet-name>gateway</servlet-name>
		<servlet-class>
			org.red5.server.net.servlet.AMFGatewayServlet
		</servlet-class>
	</servlet>
__________________
i = (Andy)this;
bowljoman is offline   Reply With Quote
Old 09-29-2008, 02:12 PM   #4
kotime42
Registered User
 
Join Date: Aug 2008
Location: Shanghai,China
Posts: 24
Default

Quote:
Originally Posted by bowljoman View Post
Use the red5 amf gateway servlet .

add this to the web-xml file of your red5 app

Code:
	<servlet>
		<servlet-name>gateway</servlet-name>
		<servlet-class>
			org.red5.server.net.servlet.AMFGatewayServlet
		</servlet-class>
	</servlet>
Hi, bowljoman

So, what can server side handle data from client after config web.xml?
In a customized servlet, or in a plain Java class, or sth else?
kotime42 is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Optimizing Flash Web Sites for Search Engines rockcoastmedia General Chat 19 03-29-2009 09:31 PM
Some Flash Video Converter Tools Compare terry117 Detention 7 05-18-2006 02:08 AM
Flash Remoting w/ Java Blindeye Flash Remoting 5 04-12-2006 08:22 PM
flash Remoting mayur_vnit Flash Remoting 5 02-24-2006 08:24 AM
flash remoting, Coldfusion, and apostrophes fou99004 Flash Remoting 3 02-07-2006 07:17 PM


All times are GMT. The time now is 07:28 PM.

///
Follow actionscriptorg on Twitter

 


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.