Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

JSPƬ¶Î

ʹÓÃjspf
ÔÚ¿ª·¢ÖÐдjspÒ³Ãæʱ£¬Í¨³£¶¼ÒªÍ¨¹ýÈçÏ·½Ê½ÔÚjspÎļþÍ·²¿ÒýÈëÎÒÃÇÐèÒªµÄ±êÇ©¿â£¬È磺jspºËÐıêÇ©¿âJSTL£¬Struts ÖеÄ×Ô¶¨Òå±êÇ©£¬Ê±¶ø»¹ÓÐÎÒÃÇ×Ô¼ºÐ´µÄ×Ô¶¨Òå±êÇ©£º
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    Èç¹û£¬Ã¿¸öjspÒ³ÃæÎļþÖж¼ÐèÒªÊýÊ®¸ö»ò¸ü¶à±êÇ©£¬ÄÇôÿ¸öjspÎļþÒ³ÃæÖж¼ÈçÉÏÒýÈ룬ÊDz»ÊǺÜÂé·³ÄØ£¿£¡
    ½ñÌì½Ì´ó¼ÒÒ»¸ö͵ÀÁµÄ°ì·¨£¨¼ÇµÃ,¸Õ¿ªÊ¼Ñ§Ï°Èí¼þ¿ª·¢Ê±£¬Ò»Î»ÀÏʦ˵:ÓÐʱºò£¬ÄãҪѧ»á͵ÀÁ£¡£©
    ÏÂÃ棬ÇÐÈëÖ÷Ì⣺
    Äã¿ÉÒÔÔÚÄãµÄWEB¹¤³ÌĿ¼£º/WEB-INF/jspf/£¬½¨Á¢Ò»¸öcommon.jspfÎļþ£º
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
…………..
È»ºóÔÚÎÒÃǵÄweb.xmlÎļþÖмÓÈëÈçÏÂÅäÖãº
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
  ………………………
  <jsp-config>
    <jsp-property-group>
        <description>ʹÿ¸öjspÒ³Ã涼²»ÓÃÏÔʾµÄÒýÓÃjstl±ê¼Ç</description>
       <url-pattern>*.jsp</url-pattern>
       <include-prelude>/WEB-INF/jspf/common.jspf</include-prelude>
    </jsp-property-group>
  </jsp-config>
………………………
</web-app>
¾ÍÊÇÕâô¼òµ¥£¬ÒÔºóÿ¸öÒ³Ãæ¾Í²»ÓÃÔÙÒ»¸ö¸öÒýÈëÁ˱êÇ©À²¡£


Ïà¹ØÎĵµ£º

JSP filter¹ýÂËÆ÷µÄ¹¦ÄܼòÒª½éÉÜ

filter¹¦ÄÜ.ËüʹÓû§¿ÉÒԸıäÒ»¸ö requestºÍÐÞ¸ÄÒ»¸öresponse. Filter ²»ÊÇÒ»¸öservlet,Ëü²»ÄܲúÉúÒ»¸öresponse,ËüÄܹ»ÔÚÒ»¸örequestµ½´ïservlet֮ǰԤ´¦Àírequest,Ò²¿ÉÒÔÔÚÀ뿪 servletʱ´¦Àíresponse.»»ÖÖ˵·¨,filterÆäʵÊÇÒ»¸ö¡±servlet chaining¡±(servlet Á´). Ò»¸öfilter °üÀ¨:
1. ÔÚservlet±»µ÷ÓÃ֮ǰ½Ø»ñ; ......

Java/JspÅäÖÃ

JAVAÅäÖãº
1£º JAVA_HOME £º  C:\Program Files\Java\jdk1.6.0_12
2£ºCLASSPATH £º    .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
3£ºPATH £º              %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin
TomcatÅäÖ ......

¡¾jsp¡¿jspÒ³Ãæ±í¸ñºÍ±íÍ·µÄÆ´½Ó

 ×öÁËÒ»¸öСģ¿é ÐèÒª ÔÚjspÒ³ÃæÉÏ°´ÕÕExcel±¨±í¸ñʽÏÔʾ±íÍ· ËäÈ»²»¸´ÔÓ µ«ÊǵÚÒ»´Î×ö Áô¸ö¼ÍÄî
ÕâЩ¶«Î÷¸ßÊÖµ±È»ÊDz»ÐèÒªÁË µ«ÊǶÔÓÚû×ö¹ýµÄ ¿ÉÄÜ»á¸øÄãÒ»µãµãÊÕ»ñ
ҪעÒâµÄÊÇ ±íÍ·µÄrowspanºÍcolspan ºáÊúҪƥÅä ²»È»ÏÂÃæÔÙÌí¼Ó ±í¸ñ»áÂÒ ÓÐɶ²»Çå³þµÄ »¶Ó­ÁôÑÔ
<%@ page language="java" pageEncoding="UT ......

JSPÓëServletµÄÌøת¼°µÃµ½Â·¾¶·½·¨ÕûÀí

  ½ñÌìÕûÀíÏîÄ¿µÄÁ÷³Ì£¬ÔÚJSPºÍServletÖ®¼äÌøÀ´ÌøÈ¥£¬Ôø¾­Ò»¶Îʱ¼ä£¬ÎÒ¶¼ÊÇ°ÑServlet·¾¶¶¨ÒåΪ¡°/SomeServlet¡±£¬Ò²¼´¶¨ÒåΪ¸ùĿ¼£¬ÒòΪ¼æÈÝÐԱȽϺ㬵«ÊÇÓÃÁËMyEclipseÖ®ºó£¬Ð½¨µÄServletĬÈÏ·¾¶ÊÇ¡°/servlet/SomeServlet¡±£¬ÕâÑùд±ãÓÚ¹ÜÀí£¬ÁíÍâ¾ÍÊǸüÊʺϵ¥¶ÀΪServletÉèÖÃFilter£¨¹ØÓÚFilterµÄÉèÖÿÉÒԲο¼ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ