jsp嵌入flex
我们使用Google提供的iframe让jsp页面嵌入到flex中
首先,请到http://code.google.com/p/flex-iframe/下载iframe 的swc包
第二步,把swc包放入flex_libs中,如果不是web项目就放入lib下
第三步,创建一个mxml文件
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:code="http://code.google.com/p/flex-iframe/" width="100%" height="100%">
<mx:HDividedBox x="0" y="10" width="100%" height="100%">
<mx:Panel width="30%" height="100%" layout="absolute">
<code:IFrame id="frm2" source="/flexPage/import.jsp" height="100%" width="100%"/>
</mx:Panel>
<mx:Panel width="70%" height="100%" layout="absolute">
<code:IFrame id="frm" source="/flexPage/wnl.html" height="100%" width="100%"/>
</mx:Panel>
</mx:HDividedBox>
</mx:Application>
运行服务器,搞定。。。。
注意:jsp页面自己建立,请适当修改
相关文档:
在jsp中引用response.setContentType("application/msword");,打开的页面就是word样式。
1、实现word横打:
<style>
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size:841.9pt 595.3pt;//纸张的大小
mso-page-orientation:l ......
js好像本身不能获取服务器的IP,但JSP可以,所以用个隐藏域,js就可以借鸡下蛋了。
jsp代码如下:
<input type="hidden" id="serviceIp" name="serviceIp" value="<%=InetAddress.getLocalHost().getHostAddress()%>">
js代码如下:
function getServiceIP(){
var ser ......
index.jsp:
<html>
<head>
<title>The News</title>
</head>
<body>
<h1> Latest News</h1>
<table>
<tr>
<td><h3><%@include file="items/news1.jsp" %></h3></td>
</tr>
<tr>
<td> ......
在编写JSP程序时,常常会碰到中文字符处理的问题,在接受request的中文字符时显示出来一串乱码。网上处理方法一箩筐,下面说说我用过的两种有效地解决办法:
1.为程序编写一个字符串处理函数,用一个静态文件保存,在需要处理中文字符的JSP页面中包含它,
<%!
public String codeToString(String str)
{ ......