flex与struts2整合_第1页
flex与struts2整合_第2页
flex与struts2整合_第3页
flex与struts2整合_第4页
flex与struts2整合_第5页
已阅读5页,还剩8页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、Flex与struts2整合1、 首先我们建立一个web项目:项目名为:flexStruts2:2、 向项目中加入struts2jar包,如下:3、修改web.xml文件,加入struts2配置:web-app version=2.4 xmlns= xmlns:xsi=/2001/XMLSchema-instance xsi:schemaLocation= struts-cleanuporg.apache.struts2.dispatcher.ActionContextCleanUpstrutsorg.apache.struts2.dispatcher.Filt

2、erDispatcherstruts*.jspstruts*.action index.jsp 4、 加入flexjar包:5、在项目WEBINF目录下建文件夹“flex”,并加入:messaging-config.xml、proxy-config.xml、remoting-config.xml、services-config.xml,如:5、 再次修改web.xml:web-app version=2.4 xmlns= xmlns:xsi=/2001/XMLSchema-instance xsi:schemaLocation= contextConfigLoc

3、ation/WEB-INF/classes/applicationContext.xmlBlazeDS BlazeDS Application flex.messaging.HttpFlexSession MessageBrokerServlet flex.messaging.MessageBrokerServlet services.configuration.file /WEB-INF/flex/services-config.xml 1 This is the description of my J2EE component This is the display name of my

4、J2EE component UploadServlet .UploadServlet struts-cleanuporg.apache.struts2.dispatcher.ActionContextCleanUpstrutsorg.apache.struts2.dispatcher.FilterDispatcherstruts*.jspstruts*.action index.jsp 6、 用tomcat发布:7、 选中项目点右键,把flex整合进来:8、 选择下一步:9、 出现如图:注意:之前启动的tomcat一定不要关,否则点的时候左上角会出现如下提示:只

5、有点击出现才是正确的。这样我们就把flex整合进来了。10、接下来可能会出现如下情况:出现这个不要慌,选中项目右键:再选择如图:选择对应的flex版本点“Ok”呵呵。解决问题!10、 接下来结合struts2做一个登录:flexStruts2.xml代码如下: Application font-size:12px; font-style: normal; font-weight: normal; username.text userpassword.text src下struts.xml: 写一个action类:LoginAction.javapackage com.action;import

6、 javax.servlet.http.HttpServletResponse;import org.apache.struts2.ServletActionContext;import com.opensymphony.xwork2.ActionSupport;public class LoginAction extends ActionSupport private String username;private String userpassword;public String execute() throws ExceptionHttpServletResponse response

7、= ServletActionContext.getResponse();response.getWriter().write(success);System.out.println(用户名:+username+ 密码:+userpassword);return null;public String getUsername() return username;public void setUsername(String username) this.username = username;public String getUserpassword() return userpassword;public v

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论