社区
Web 开发
帖子详情
关于flex和struts整合问题
hwy000
2009-04-03 05:24:51
谁有关于flex和struts框架整合方面的资料, 最好有步骤和例子的..
...全文
345
2
打赏
收藏
关于flex和struts整合问题
谁有关于flex和struts框架整合方面的资料, 最好有步骤和例子的..
复制链接
扫一扫
分享
举报
写回复
配置赞助广告
用AI写文章
2 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
fish200x
2009-09-11
打赏
举报
回复
flex和struts完全是2个项目中的
除非你用bladzs,可以让flex直接调用java类
其实说不上整合:因为flex有专门和action通信的方法!
httpservice和webservice
个人认为httpservice比较方便,而且方便
可以直接给action传参!
false2true
2009-09-10
打赏
举报
回复
转载于:http://blog.csdn.net/adriano86426/archive/2009/02/23/3928454.aspx 版权归原作者所有。若涉及侵犯权益,本人恕不负责:
flex 整合 struts 的一个简单示例(使用Httpservice) 收藏
关于在Eclipse下 flex整合java的配置请参考: http://aaacd.blog.hexun.com/15758049_d.html
这里是一个flex整合struts的一个基本的例子
1. testFlex10.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
backgroundColor="#FFFFFF"
backgroundAlpha="0" horizontalCenter="true" >
<mx:HTTPService id="info" url="test.do">
<mx:request>
<username>
{userId.text}
</username>
<userpwd>
{password.text}
</userpwd>
</mx:request>
</mx:HTTPService>
<mx:TitleWindow id ="loginWindow" xmlns:mx="http://www.adobe.com/2006/mxml" title="Logon" x="350" y="80">
<mx:Form>
<mx:FormItem label="LUserId" required="true">
<mx:TextInput id="userId" width="150">
</mx:TextInput>
</mx:FormItem>
<mx:FormItem label="LPassword" required="true">
<mx:TextInput id="password" width="150"/>
</mx:FormItem>
<mx:FormItem>
<mx:HBox horizontalGap="30">
<mx:Button label="Logon" click="info.send();" />
<mx:Button label="Cancel" click="info.send();"/>
</mx:HBox>
</mx:FormItem>
</mx:Form>
</mx:TitleWindow>
<mx:DataGrid dataProvider="{info.lastResult.userinfo.user}" width="60%" x="160" y="300" >
<mx:columns>
<mx:Array>
<mx:DataGridColumn headerText="姓名" dataField="username"/>
<mx:DataGridColumn headerText="密码" dataField="userpwd"/>
<mx:DataGridColumn headerText="邮件" dataField="useremail"/>
<mx:DataGridColumn headerText="年龄" dataField="userage"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
</mx:Application>
核心代码:
<mx:HTTPService id="info" url="test.do">
<mx:request>
<username>
{userId.text}
</username>
<userpwd>
{password.text}
</userpwd>
</mx:request>
</mx:HTTPService>
以及
dataProvider="{info.lastResult.userinfo.user}"
2.struts.config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources />
<form-beans >
<form-bean name="testForm" type="com.yourcompany.struts.form.TestForm" />
</form-beans>
<global-exceptions />
<global-forwards />
<action-mappings >
<action
attribute="testForm"
input="/form/test.jsp"
name="testForm"
path="/test"
scope="request"
type="com.yourcompany.struts.action.TestAction" >
<forward name="success" path="/MyJsp.jsp"></forward>
</action>
</action-mappings>
<message-resources parameter="com.yourcompany.struts.ApplicationResources" />
</struts-config>
3.Action: TestAction.java
package com.yourcompany.struts.action;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import com.yourcompany.struts.form.TestForm;
public class TestAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
TestForm testForm = (TestForm) form;// TODO Auto-generated method stub
String name = testForm.getUsername();
System.out.println("fadf : " + name);
return (mapping.findForward("success"));
}
}
4. MyJsp.jsp
<%@page import="
java.util.List"%>
<%
response.setContentType("text/xml");
out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?>");
out.println("<userinfo>");
out.println("<user userId=\""+3123+"\">");
out.println("<username>"+42314+"</username>");
out.println("<userpwd>"+3123+"</userpwd>");
out.println("<useremail>"+4231+"</useremail>");
out.println("<userage>"+2+"</userage>");
out.println("<regdate>"+4231+"</regdate>");
out.println("</user>");
out.println("</userinfo>");
%>
什么是amf
今天我们开发的 J2EE 网络应用程序,在表现层常用的就是
Struts
, Tapestry, WebWork, or Spring。这些工具一般使用MVC体系结构,输出HTML到浏览器。典型的程序网络开发模型就是要求 用户对程序的每一个动作都要发送请求到服务器上。对于程序的每个用户请求,服务器生成一个回复允许用户提交一个新请求用以获得更多信息。一个浏览器通常用来为用户渲染界面。但是浏览器是一个有太...
Flex
与
Struts
整合
:必备包与步骤解析
本文还有配套的精品资源,点击获取 简介:
Flex
和
Struts
分别用于构建富互联网应用和Java EE平台的MVC框架,两者的
整合
可实现强大的前后端交互。
整合
前必须确保正确配置Java开发环境、安装Tomcat、
Struts
库、
Flex
SDK和Flash Player。IDE和构建工具的选择也很关键。
整合
过程中需要在
Flex
客户端使用ActionScript调用服务端St...
Flex
2与
Struts
整合
配置-续搭建免费的
flex
开发环境flashdevelop
Flex
2与
Struts
整合
配置 -续搭建免费的
flex
开发环境flashdevelop 1.下载软件 a)
Flex
data service: http://www.adobe.com/products/
flex
/ b)
struts
: http://
struts
.apache.org/download.cgi c)Tomcat: http://tomcat.apache.org/download
flex
整合
struts
的一个简单示例(使用Httpservice)
关于在Eclipse下
flex
整合
java的配置请参考: http://aaacd.blog.hexun.com/15758049_d.html 这里是一个
flex
整合
struts
的一个基本的例子 1. test
Flex
10.mxml http://www.adobe.com/2006/mxml" layout="absolute" backgroundCol
flex
3+
struts
1.3+spring+ibatis 2.x
整合
代码实例
flex
3+
struts
1.3+spring+ibatis 2.x
整合
代码实例 源代码下载地址:http://www.zuidaima.com/share/1778657261997056.htm
Web 开发
81,108
社区成员
341,721
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章