JSPÖж¯Ì¬INCLUDEÓ뾲̬INCLUDEµÄÇø±ð
ÎÒÃǶ¼ÖªµÀÔÚjspÖÐincludeÓÐÁ½ÖÖÐÎʽ,·Ö±ðÊÇ
<%@ include file=" "%>
<jsp:include page=" " flush="true"/>
Ç°ÕßÊÇÖ¸ÁîÔªËØ¡¢ºóÕßÊÇÐÐΪԪËØ.
ͨ³£µ±Ó¦ÓóÌÐòÖÐËùÓеÄÒ³ÃæµÄijЩ²¿·Ö(ÀýÈç±êÌâ¡¢Ò³½ÅºÍµ¼º½À¸)¶¼ÏàͬµÄʱºò,ÎÒÃǾͿÉÒÔ¿¼ÂÇÓÃinclude.¾ßÌåÔÚÄÄЩʱºòÓÃ<%@ include file=" "%>,ÄÄЩʱºòÓÃ<jsp:include page=" " flush="true"/>.ÕâÖÖÐÎʽ.Ê×ÏÈÒªÃ÷°×µÄÊÇËüÃÇÖ®¼äµÄÇø±ð.
<%@ include file=" "%>,jspµÄincludeÖ¸ÁîÔªËضÁÈëÖ¸¶¨Ò³ÃæµÄÄÚÈÝ.²¢°ÑÕâЩÄÚÈݺÍÔÀ´µÄÒ³ÃæÈںϵ½Ò»Æð.(Õâ¸ö¹ý³ÌÊÇÔÚ·Òë½×¶Î:Ò²¾ÍÊÇjsp±»×ª»¯³ÉservletµÄ½×¶Î½øÐеģ©.
ÕâÀï¶Ô·Òë½×¶Î½øÐÐÒ»ÏÂ˵Ã÷:ÎÒÃÇÖªµÀ,jspÒ³Ãæ²»ÄÜÔ·â²»¶¯µØ±»´«Ë͸øä¯ÀÀÆ÷,ËùÓеÄjspÔªËض¼±ØÐëÊ×ÏÈÓÉ·þÎñÆ÷½øÐд¦Àí.ÕâÊÇͨ¹ý½«jspÒ³Ãæת´ï»¯³Éservlet,È»ºóÖ´ÐÐÕâ¸öservletÀ´Íê³ÉµÄ.·þÎñÆ÷ÐèÒªÒ»¸öjspÈÝÆ÷À´´¦ÀíjspÒ³Ãæ.jspÈÝÆ÷ͨ³£ÒÔservletµÄÐÎʽÀ´ÊµÏÖ,Õâ¸öservlet¾¹ýÅäÖÃ,¿ÉÒÔ´¦Àí¶ÔjspÒ³ÃæµÄËùÓÐÇëÇó.
JspÈÝÆ÷¸ºÔð½«jspÒ³Ãæת»¯³Éservlet(³ÆΪjspÒ³ÃæʵÏÖÀà?JSP Page implementation class),²¢±àÒëÕâ¸öservlet.ÕâÁ½²½¾Í¹¹³ÉÁË·Òë½×¶Î.
ÓÉ´ËÎÒÃǾͻáÖªµÀ:jspÒ³ÃæÊÇ°ÑincludeÖ¸ÁîÔªËØËùÖ¸¶¨µÄÒ³ÃæµÄʵ¼ÊÄÚÈÝ(Ò²¾ÍÊÇ´úÂë¶Î)¼ÓÈëµ½ÒýÈëËüµÄjspÒ³ÃæÖÐ,ºÏ³ÉÒ»¸öÎļþºó±»jspÈÝÆ÷½«Ëüת»¯³Éservlet.¿ÉÒÔ¿´µ½Õâʱ»á²úÉúÒ»¸öÁÙʱclassÎļþºÍÒ»¸öjavaÎļþ.ÏÂÃæ¾Ù¸öÀý×Ó.
·þÎñÆ÷ÓÃtomcat,ÒýÈëÒ³ÃæµÄjspÎļþ½Ðtest.jsp.±»ÒýÈëµÄÒ³Ãæ½Ðdate.jsp.Õâ¸öjspÎļþÀï´æ·ÅµÄÊÇÒ»¸öÓйØʱ¼äµÄjsp´úÂë,µ±Ç°µÄÉÏÏÂÎĸùÉèΪtest
//======date.jspµÄÔ´Îļþ=====//
<%@ page language="java" contentType="text/html;charset=gb2312"%>
<%
java.util.Date date=new java.util.Date();
String date_cn ="";
String dateStr = "";
switch(date.getDay())
{
case 0:date_cn ="ÈÕ"; break;
case 1:date_cn ="Ò»"; break;
case 2:date_cn
Ïà¹ØÎĵµ£º
JSPÖÐfilter¹ýÂËÆ÷ÑéÖ¤Óû§µÇ¼
ÏÖÔÚJSPʹÓÃÔ½À´Ô½¹ã·ºÁË£¬ÓÈÆäÊǺܶàÕþ¸®µÄÍøÕ¾¶¼²ÉÓÃÁËJSP¼¼Êõ£¬Æ书ÄÜÇ¿´óÇÒ°²È«¡£
³õѧÕߺܶàÓÐÕâô¸öÎÊÌ⣬¾ÍÊÇ£¬ÍøÕ¾µÄÒ»¸öȨÏÞÉèÖ㬱ÈÈçµÇ¼Óû§¿ÉÒԲ鿴ÄÄЩҳÃ棬¶øÓοÍÓÖÓÐȨÏÞ¿ÉÒÔ¿´ÄÄЩÄÚÈÝÄØ£¿
JSPÊÇÇ¿´óµÄ£¬µ«Æä´úÂ뻹ÊÇÏà¶Ô·±ËöµÄ£¬ÆäʵÓÃÒ»¸ö¹ýÂËÆ÷(filter)¾Í¿ÉÒÔʵÏÖÕ ......
ÔÚWEBÓ¦ÓÃÖÐ,Èç¹ûʹÓÃjsp×÷Ϊview²ãµÄÏÔʾģ°å,¶¼»á±»¿Õ¸ñ/¿Õ»»ÐÐÎÊÌâËùÀ§ÈÅ.
Õâ¸öÎÊÌâµ±ÄêÒ²À§ÈÅÁËÎұȽϳ¤µÄʱ¼ä.ÒòΪÔÚjspÄÚʹÓõÄEL±êÇ©ºÍÆäËû±êǩʱ,»á²úÉú´óÁ¿µÄ¿Õ¸ñºÍ»»Ðзû.ÀýÈç:
------- start ----------
<c:choose>
<c:when test="${fn:length(mainPageList)>1&}&q ......
ÔÚ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 ......
¹ØÓÚJSPÖÐorg.apache.jasper.JasperException:
This absolute uri http://java.sun.com/jsp/jstl/core ) cannot be resolved in either web.xml or the jar files deployed with this application
´ÓÍøÉÏËÑÁËһϣ¬ÏàͬµÄ˵·¨ÊÇ£ºÒ»¸ö¾ÍÊÇJSTLµÄ°æ±¾ÎÊÌ⣨1.0Óë1.1£©£¬ÊÇ·ñ²»Ò»Ö ......
Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
¶þ¡¢±íµ¥Ìá½»ÖÐÎÄʱ³öÏÖÂÒÂë
Èý¡¢Êý¾Ý¿âÁ¬½Óʱ³öÏÖÂÒÂë
´ó¼ÒÔÚJSPµÄ¿ª·¢¹ý³ÌÖУ¬¾³£³öÏÖÖÐÎÄÂÒÂëµÄÎÊÌ⣬¿ÉÄÜÒ»ÖÁÀ§ÈÅ×ÅÄú£¬ÎÒÏÖÔÚ°ÑÎÒÔÚJSP¿ª·¢ÖÐÓöµ½µÄÖÐÎÄÂÒÂëµÄÎÊÌâ¼°½â¾ö°ì·¨Ð´³öÀ´¹©´ó¼Ò²Î¿¼¡£
Ò»¡¢JSPÒ³ÃæÏÔʾÂÒÂë
ÏÂÃæµÄÏÔʾҳÃæ(display.jsp)¾ ......