JSPÒ³ÃæÏÔʾÂÒÂë
Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
ÏÂÃæµÄÏÔʾҳÃæ(display.jsp)¾Í³öÏÖÂÒÂ룺
<html>
<head>
<title>JSPµÄÖÐÎÄ´¦Àí</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
out.print("JSPµÄÖÐÎÄ´¦Àí");
%>
</body>
</html>
¶Ô²»Í¬µÄWEB·þÎñÆ÷ºÍ²»Í¬µÄJDK°æ±¾£¬´¦Àí½á¹û¾Í²»Ò»Ñù¡£ÔÒò£º·þÎñÆ÷ʹÓõıàÂ뷽ʽ²»Í¬ºÍä¯ÀÀÆ÷¶Ô²»Í¬µÄ×Ö·ûÏÔʾ½á¹û²»Í¬¶øµ¼Öµġ£½â¾ö°ì·¨£ºÔÚJSPÒ³ÃæÖÐÖ¸¶¨±àÂ뷽ʽ(gb2312),¼´ÔÚÒ³ÃæµÄµÚÒ»ÐмÓÉÏ£º<%@ page contentType="text/html; charset=gb2312"%>£¬¾Í¿ÉÒÔÏû³ýÂÒÂëÁË¡£ÍêÕûÒ³ÃæÈçÏ£º
<%@ page contentType="text/html; charset=gb2312"%>
<html>
<head>
<title>JSPµÄÖÐÎÄ´¦Àí</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%
out.print("JSPµÄÖÐÎÄ´¦Àí");
%>
</body>
</html>
Ïà¹ØÎĵµ£º
JSP ʵÔÚservlet Ö®ºó·¢Õ¹ÆðÀ´µÄ¼¼Êõ¡£
ÔËÐлúÖÆ£º
1£ºjspÎļþÌá½»·þÎñÆ÷£¬·þÎñÆ÷ £¨Tomcat£©£¬³õʼ»¯ ÇëÇóºÍÏìÓ¦¶ÔÏó £¬È»ºóÅжÏjspÎļþÊÇ·ñ´æÔÚ £¬Èç¹û²»´æÔÚ 404 ´íÎ󣬴æÔÚ £¬±àÒë³ÉΪ ¡£java Îļþ ----¡·¡£class Îļþ ¡£¾ÍÊÇÒ»¸öjavaµÄÀà £¬Õâ¸öÀà £¬¼Ì³Ð×Ô httpjspbase £¬Õâ¸öhttpjsppageÀà ÓÖ ÊµÏÖÁË» ......
ÎÒÃǶ¼ÖªµÀÔÚjspÖÐincludeÓÐÁ½ÖÖÐÎʽ,·Ö±ðÊÇ
< %@ include file=” ”%>
< jsp:include page=” ” flush=”true”/>
¡¡¡¡Ç°ÕßÊÇÖ¸ÁîÔªËØ¡¢ºóÕßÊÇÐÐΪԪËØ¡£¾ßÌåËüÃǽ«Ôںδ¦Óã¿ÈçºÎÓü°ËüÃÇÓÐʲôÇø±ð£¿ÕâÓ¦¸ÃÊǺܶàÈË¿´µ½Ëü¶¼»áÏëµ½µÄÎÊÌâ¡£ÏÂÃæÒ»ÆðÀ´¿´¿´°É¡£
¡ ......
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 ......
Ò»¡¢»ù±¾¸ÅÄ 1.±êÇ©(Tag): ±êÇ©ÊÇÒ»ÖÖXMLÔªËØ£¬Í¨¹ý±êÇ©¿ÉÒÔʹJSPÍøÒ³±äµÃ¼ò½à²¢ÇÒÒ×ÓÚά»¤£¬»¹¿ÉÒÔ·½±ãµØʵÏÖͬһ¸öJSPÎļþÖ§³Ö¶àÖÖÓïÑÔ°æ±¾¡£ÓÉÓÚ±êÇ©ÊÇXMLÔªËØ£¬ËùÒÔËüµÄÃû³ÆºÍÊôÐÔ¶¼ÊÇ´óСдÃô¸ÐµÄ 2.±êÇ©¿â(Tag library): ÓÉһϵÁй¦ÄÜÏàËÆ¡¢Âß¼ÉÏ»¥ÏàÁªÏµµÄ±êÇ©¹¹³ÉµÄ¼¯ºÏ³ÆΪ±êÇ©¿â¡£ 3.±êÇ©¿âÃèÊöÎļþ(Tag Libr ......
ÓÃÕýÔò±í´ïʽÏÞÖÆÖ»ÄÜÊäÈëÖÐÎÄ£ºonkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"
ÓÃÕýÔò±í´ïʽÏÞÖÆÖ»ÄÜÊäÈëÈ«½Ç×Ö·û£º onkeyup="value=value.replace(/[^\uFF00-\uFFFF]/g,'')" onbeforepaste="cl ......