怎样将flex嵌入到jsp中?
- 提问者网友:十年饮冰
- 2021-04-22 15:53
- 五星知识达人网友:雾月
- 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