Flex is embedded in JSP in the form of jstl. The first sentence in the JSP file is
<% @ Taglib uri = "flextaglib" prefix = "mm" %>
Below is the running
Source code test. jsp
The input and output characters in JSP are encoded. I use tomcat5.5, which may vary with other servers!
<% @ 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 = "add">
</Form>
</Html>