JSPÄÚÖöÔÏó
jspÄÚÖöÔÏó
¡¡¡¡¶¨Ò壺¿ÉÒÔ²»¼ÓÉùÃ÷¾ÍÔÚJSPÒ³Ãæ½Å±¾£¨Java³ÌÐòƬºÍJava±í´ïʽ£©ÖÐʹÓõijÉÔ±±äÁ¿
¡¡¡¡JSP¹²ÓÐÒÔÏÂ9ÖÖ»ù±¾ÄÚÖÃ×é¼þ£¨¿ÉÓëASPµÄ6ÖÖÄÚ²¿×é¼þÏà¶ÔÓ¦£©£º
¡¡¡¡
ÄÚÖöÔÏó
´ú±íÄÚÈÝ
·¶Î§
request
´¥·¢·þÎñµ÷ÓõÄÇëÇó
request
response
¶ÔÇëÇóµÄÓ¦´ð
page
session
ΪÇëÇóµÄ¿Í»§´´½¨µÄsession¶ÔÏó
session
application
´Ó servlet ÅäÖöÔÏó»ñµÃµÄ servlet ÉÏÏÂÎÄ£¨ÈçÔÚgetServletConfig() £¬getContext()µÄµ÷ÓÃÖУ©
application
out
ÏòÊä³öÁ÷дÈëÄÚÈݵĶÔÏó
page
pageContext
±¾ JSP µÄÒ³ÃæÉÏÏÂÎÄ
page
page
ʵÏÖ´¦Àí±¾Ò³µ±Ç°ÇëÇóµÄÀàµÄʵÀý
page
config
±¾ JSP µÄ ServletConfig
page
exception
±íʾJSPÒ³ÃæÔËÐÐʱ²úÉúµÄÒì³£
Page
Ïà¹ØÎĵµ£º
<%
//header.jsp
out.println("Protocol: " + request.getProtocol() + "<br>");
out.println("Scheme: " + request.getScheme() + "<br>");
out.println("Server Name: " + request.getServerName() + "<br>" );
out.println(&quo ......
package com.pan.encod;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
public class EncodFilter impl ......
¸Ã±êÇ©ÓÃÓÚÏòÄ¿±êÒ³ÃæÖеIJÎÊý´«Öµ£¬¸Ã±êǩͨ³£Óëjsp:include»òjsp:forward±êÇ©Ò»ÆðʹÓÃ
¸ñʽ£º<jsp:param name=? value=? />
name£ºÄ¿±êÒ³ÃæÖеÄij²ÎÊýÃû
value£ºÏònameÖ¸¶¨µÄ²ÎÊýËù´«µÄÖµ
Ò»¸öÒ³ÃæÖпÉÒÔÊ ......
1.jsp:include±êÇ©ÊÇÔÚÖ´ÐÐʱ²Å¶Ô¼ÓÔصÄÎļþ½øÐд¦Àí£¬Òò´ËJspÒ³ÃæºÍËüËù¼ÓÔصÄÎļþÔÚÂß¼ºÍÓï·¨É϶¼ÊǶÀÁ¢µÄ£¬Èç¹û¶Ô¼ÓÔØÎļþ½øÐÐÐ޸ģ¬ÄÇôÔËÐÐʱ¿ÉÒÔ¿´µ½Ëù¼ÓÔØÎļþÐ޸ĺóµÄ½á¹û
2.¶øÓÃincludeÖ¸Áî¼ÓÔØÎļþʱ£¬Êǽ«¼ÓÔØÎļþºÍJspÒ³ÃæºÏ²¢³ÉÒ»¸öеÄJspÒ³Ãæºó£¬·¢Ë͸øJspÒýÇæ½øÐд¦ÀíµÄ£¬Òò´ËÈç¹û¼ÓÔØÎļþ·¢Éú±ä»¯£¬Ôò±Ø ......