继续关注我的C语言学习博客

林临的地盘

java学习博客
posts - 44, comments - 28, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

flash与jsp的交互

Posted on 2007-03-28 09:08 lubaolin 阅读(2850) 评论(2)  编辑  收藏 所属分类: java
1)swf从jsp读数据
a) 在flash中建一个动态文本框,一个button;文本框名字叫str,button上写


on (release) {
loadVariable("http://localhost:8080/demo/sentVar.jsp", "","get");
}//url相对,绝对路径好像都可以


b) 在sentVar.jsp中写如下代码:
<%@ page contentType="text/html;charset=gb2312"%>
<%
String tmp="wowowo";
out.println("&str="+tmp);//这里一定要写成"&str="的形式,&一定不能少,str的名字要与你a中建的相同,“= ”号也不能少;
%>
c)测试。click button ...yeah~(failed?its none of my business) try again~~

-------------------------------------------------------------------

2)swf向jsp写数据
这个简单点。

c建一input textfield,起个名字str吧。一个button,上面写:
on (release) {
getURL("showrs.jsp", "","get");
}


b)showrs.jsp中写:

<%@ page contentType="text/html;charset=gb2312"%>
<%
String tem=request.getParameter("str");
out.println("str="+tem);
%>

everything is ok~enjoy...

引自:http://www.flashempire.net/showpost.php?p=892409

评论

# re: flash与jsp的交互  回复  更多评论   

2008-07-06 18:27 by JohnRowen

# re: flash与jsp的交互  回复  更多评论   

2008-08-26 14:54 by 路过
loadVariable->loadVariables

只有注册用户登录后才能发表评论。


网站导航:
 
继续关注我的C语言学习博客