Flex是以JSTL形式嵌入Jsp的,Jsp文件里的头一句就是
以下是引用片段:
<%@ taglib uri="FlexTagLib" prefix="mm" %>
源代码test.jsp
其中对jsp中的输入输出字符进行了编码,我用的是Tomcat5.5,用其他服务器的话可能会不同!
以下是引用片段:
<%@ taglib uri="FlexTagLib" prefix="mm" %>
<%@ page contentType="text/html; charset=utf-8" %>
<html>
<%
String data = (String)session.getAttribute("data");
String name = new String(request.getParameter("name").getBytes("8859_1"), "utf-8") ;
String email = new String(request.getParameter("email").getBytes("8859_1"), "utf-8") ;
data = data + "<mydata name='"+name+"' email='"+email+"'/>";
//System.out.println(data);
session.setAttribute("data", data);
%>
This is html powered by jsp<br>
<mm:mxml>
<mx:Application width="300" height="200" xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Model id="myModel">
<%= session.getAttribute("data") %>
</mx:Model>
<mx:DataGrid width="100%" height="100%" dataProvider="{myModel.mydata}"/>
</mx:Application>
</mm:mxml>
<form action="" method="post">
name: <input name="name"><br>
email: <input name="email"><br>
<input type="submit" value="添加">
</form>
</html>
web xml 中加入:
<jsp-config>
<taglib>
<taglib-uri>FlexTagLib</taglib-uri>
<taglib-location>/WEB-INF/lib/flex-bootstrap-jsp.jar</taglib-location>
</taglib>
</jsp-config>
【】http://hi.baidu.com/nickol/blog/item/c8f851dad6824edbb6fd48e1.html
【】http://www.iteye.com/problems/54672
【实例】http://www.cnblogs.com/dannyr/archive/2004/12/12/76049.html