IntelliWeb 中嵌入Silverlight/Flash方法

    简介:intelliWeb 是基于构件、Ajax、RichClient技术的J2EE应用快速开发平台。

    嵌入Silverlight/Flash方法 很简单,把ActiveX放到e:Page 里面就可以了

   下面我以Silverlight为例 贴一个页面完整代码供参考:(intelliWeb 新建一个JSP页面)

 

<%@ page language="java" contentType="text/html; charset=GB18030"  pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<e:View id="eView" designProperty="width: 1024px; height: 768px">
        
<body>
<e:Page id="ePage" action="com.longtop.tx.board.targacct.web.PortalTargAcctBoardAction" style="width: 100%; height: 100%;">
		<object id="silverlightControlHost" name="data:application/x-silverlight-2," type="application/x-silverlight-2" width="828" height="258" align="middle" data="data:application/x-silverlight-2,">
			
		  <param name="source" value="SilverlightApplication1.zip"/>
		  <param name="onError" value="onSilverlightError" />
		  <param name="background" value="white" />
		  <param name="minRuntimeVersion" value="4.0.50826.0" />
		  <param name="autoUpgrade" value="true" />
		  <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
 			  <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
		  </a>
		</object>
		
	</e:Page>
</body>
<script type="text/javascript">
    
        function onSilverlightError(sender, args) {
            var appSource = "";
            if (sender != null && sender != 0) {
              appSource = sender.getHost().Source;
            }
            
            var errorType = args.ErrorType;
            var iErrorCode = args.ErrorCode;

            if (errorType == "ImageError" || errorType == "MediaError") {
              return;
            }

            var errMsg = "Unhandled Error in Silverlight Application " +  appSource + "\n" ;

            errMsg += "Code: "+ iErrorCode + "    \n";
            errMsg += "Category: " + errorType + "       \n";
            errMsg += "Message: " + args.ErrorMessage + "     \n";

            if (errorType == "ParserError") {
                errMsg += "File: " + args.xamlFile + "     \n";
                errMsg += "Line: " + args.lineNumber + "     \n";
                errMsg += "Position: " + args.charPosition + "     \n";
            }
            else if (errorType == "RuntimeError") {           
                if (args.lineNumber != 0) {
                    errMsg += "Line: " + args.lineNumber + "     \n";
                    errMsg += "Position: " +  args.charPosition + "     \n";
                }
                errMsg += "MethodName: " + args.methodName + "     \n";
            }

            throw new Error(errMsg);
        }
    </script>
    </e:View>
</html>




你可能感兴趣的:(html,function,Microsoft,application,action,silverlight)