jspÖÐWord´òÓ¡
jspÖÐWord´òÓ¡
¡¡ÏêϸÎÄ×Ö ÏêϸͼÎÄ
ÔÚ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:landscape;
margin:89.85pt 72.0pt 89.85pt 72.0pt;
mso-header-margin:42.55pt;//ҳü
mso-footer-margin:49.6pt;//Ò³½Å
mso-paper-source:0;
layout-grid:15.6pt;}
div.Section1
{page:Section1;}
</style>
ʹÓÃ<div class="Section1"></div>¼´¿ÉʵÏÖ
2¡¢×Ô¶¨ÒåÖ½ÕÅ´óС×Ý´ò
@page
{mso-page-border-surround-header:no;
mso-page-border-surround-footer:no;}
@page Section1
{size: 21.5cm 14.00cm;
margin-left:0.5cm;//×óÒ³±ß¾à
margin-right:0.5cm;//ÓÒÒ³±ß¾à
margin-top:0.5cm;//ÉÏÒ³±ß¾à
margin-bottom:0.5cm//ÏÂÒ³±ß¾à;
mso-header-margin:0.5cm;
mso-footer-margin:0.5cm;
layout-grid:0.5pt;}
div.Section1
{page:Section1;}
Ïà¹ØÎĵµ£º
Æä´úÂëÈçÏÂ:
<%@page language="java" contentType="text/html" import="java.util.*" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<body>
<%
int a=9;
int b=0;
try{
%>
<%=(a/b)%>
<%
}cat ......
JSP ÈçºÎʵÏÖÍøÒ³¶¨Ê±Ìøת:
<script language="javascript">
<!--
setTimeout("document.location.href='http://www.163.com'",3000);
//-->
</script>
ˢУº
<meta http-equiv="Refresh" content ......
1.Ê×ÏÈÔÚjspÒ³ÃæÖÐÉú³ÉÑéÖ¤ÂëͼƬ£¬image.jsp
<%@ page contentType="image/jpeg"%>
<%@ page import="java.awt.*,java.awt.image.*,java.util.*,javax.imageio.*" %>
<%!
Color getRandColor(int fc,int bc){//¸ø¶¨·¶Î§»ñµÃËæ»úÑÕÉ«
Random random = new Random();
......
ÎÒÃǶ¼ÖªµÀÔÚjspÖÐincludeÓÐÁ½ÖÖÐÎʽ,·Ö±ðÊÇ
< %@ include file=” ”%>
< jsp:include page=” ” flush=”true”/>
¡¡¡¡Ç°ÕßÊÇÖ¸ÁîÔªËØ¡¢ºóÕßÊÇÐÐΪԪËØ¡£¾ßÌåËüÃǽ«Ôںδ¦Óã¿ÈçºÎÓü°ËüÃÇÓÐʲôÇø±ð£¿ÕâÓ¦¸ÃÊǺܶàÈË¿´µ½Ëü¶¼»áÏëµ½µÄÎÊÌâ¡£ÏÂÃæÒ»ÆðÀ´¿´¿´°É¡£
¡ ......