永发信息网

怎样将flex嵌入到jsp中?

答案:2  悬赏:40  手机版
解决时间 2021-04-23 14:21
  • 提问者网友:十年饮冰
  • 2021-04-22 15:53
怎样将flex嵌入到jsp中?
最佳答案
  • 五星知识达人网友:雾月
  • 2021-04-22 16:32

今天刚发现有这功能,下边是web.xml一部分,说明可以之间通过a.mxml a.swf a.as来用浏览器访问。早就下了flex_module_j2ee.zip(里边有个weither.war)就是不知道怎么用。原来这么好,这样就可以更加动态的改变flex显示结果。tomcat不要用blazeds自带的。下个apache的
教程 http://www.slideshare.net/hominh ... in-jsp-presentation
<servlet-mapping>
<servlet-name>FlexMxmlServlet</servlet-name>
<url-pattern>*.mxml</url-pattern>
</servlet-mapping>
- <servlet-mapping>
<servlet-name>FlexSwfServlet</servlet-name>
<url-pattern>*.swf</url-pattern>
</servlet-mapping>
- <servlet-mapping>
<servlet-name>FlexForbiddenServlet</servlet-name>
<url-pattern>*.as</url-pattern>
</servlet-mapping>
- <servlet-mapping>
<servlet-name>FlexForbiddenServlet</servlet-name>
<url-pattern>*.swc</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>FlexTagLib</taglib-uri>
<taglib-location>/WEB-INF/lib/flex-bootstrap-jsp.jar</taglib-location>
</taglib>


jsp:代码
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@ taglib uri="FlexTagLib" prefix="mm" %> <%--引入flex tag --%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'hello.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->


</head>

<body>
<mm:mxml>
<mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*">
<mx:Text text="Hello World" />
<% if (request.isUserInRole("admin")) { %>
<AdminConsole/>
<% } else { %>
<UserConsole/>
<% } %>


</mx:Application>
</mm:mxml>


</body>
</html>

全部回答
  • 1楼网友:有你哪都是故乡
  • 2021-04-22 16:55
将FLEX嵌入到JSP,其实是通过JSP的TAGLIB实现的. 步骤还是蛮简单的 1:去ADOBE下载FLEX的TAGLIB for JSP. 2:将flex-webtier-jsp.jar 拷贝到WEB-INF/flex/jars 文件夹. 3:在WEB.XML中添加<taglib> <taglib-uri>FlexTagLib</taglib-uri> <taglib-location>/WEB-INF/lib/flex-bootstrap-jsp.jar</taglib-location> </taglib> 4:如果SERVER开着的话,重启. 5:可以在JSP文件中写FLEX代码了!TADOEBA:===================== test.jsp START =====================<%@ taglib uri="FlexTagLib" prefix="mm" %> <%@ page contentType="text/html; charset=utf-8" %> <html> This is html powered by jsp<br> <mm:mxml source="MainApp.mxml" width="100%" height="100%"> </mm:mxml> </html>===================== test.jsp End =====================这个例子非常简单就是将原来写好的MXML文件嵌入到JSP中.MainApp.mxml可以改成你需要嵌入的FLEX文件. 那两个jar包没找到抱歉!!!! 下面的链接可以下(不过要Money!!!) http://www.pudn.com/downloads136/sourcecode/java/javascript/detail581571.html
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯