jsp ±êÇ©taglib²»Æð×÷ÓõÄÎÊÌâ
JSTL <c:out value="${EL}">²»ÄÜÕýÈ·Êä³öµÄÎÊÌâ
ÓÉÓÚJsp2.0Ïòºó¼æÈݵÄÌØÐÔ£¬ µ±Óöµ½Ê¹ÓÃJsp 1.2£¨Servlet v2.3£©µÄÍøÕ¾Ê±»áĬÈϵĽûÓÃJSP2.0 EL£¬ËùÒÔµ¼ÖÂc:out²»ÄÜÕýÈ·Êä³ö¡£
£¨ÕâÀï×¢ÒâJsp 1.2½ûÓÃJSP2.0µÄEL£¬¶øÊÇȥʹÓÃJSTL 1.0 taglibÈ¥½âÎöEL¡£ËùÒÔʹÓÃJSP 1.2+JSTL 1.0²»»á³öÎÊÌ⣬
¶øÊ¹ÓÃÁËJSP 1.2+JSTL 1.1¾Í»áµ¼ÖÂc:out²»ÄÜÕýÈ·Êä³ö£©
ÆôÓÃEL»òÐÞ¸Äwebv.xmlΪjsp2.0¿ÉÒÔ½â¾öÎÊÌâ¡£
ÆôÓÃEL£ºÔÚjspÒ³ÃæÖмÓÈë <%@ page isELIgnored="false"%>
pageÖ¸ÁîµÄisELIgnored屬ÐÔÊÇ¿ØÖÆELµÄʹÓÃ權µÄ,ËüµÄ兩個Öµ,trueºÍfalse
Èç¹û isELIgnored='true'±íʾ½ûÓÃEL,isELIgnored='false' ±íʾ¿ÉÒÔʹÓÃEL£¬ Ĭ認ÊÇfalse
ÐÞ¸Äwebv.xmlΪjsp2.0
ΪÁËÓÃEL¸ÄΪ
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>WebModule1 </display-name>
</web-app>
Ïà¹ØÎĵµ£º
JAVA×ÛºÏÃæÊÔÌâ£ºÒ³ÃæµÄץȡ¡¢½âÎö¡¢±£´æÊý¾Ý¿âºÍÉú³ÉHTMLµÄÒ³ÃæÕ¹Ê¾ ÊÕ²Ø
´ÎÀý×Ó¿ÉÒÔÓÃÀ´Ñ§Ï°ÍøÂç±à³Ì£¬ÕýÔò±í´ïʽµÄʹÓ㬷ºÐÍ£¬Êý¾Ý¿âµÄ»ù±¾²Ù×÷µÈJAVA֪ʶ
ÎÊÌâÈçÏ£ºÀ´Ô´ÓÚÂÛ̳
http://topic.csdn.net/u/20090616/13/59aa4e2d-3752-45df-9c1b-c65c46c3e4d7.html
дһ¸öjspÒ³Ãæ£¬·ÃÎÊʱÏÔʾ´ÓÏÂÃæµÄÒ³ÃæÌ ......
ʵÏÖJSP×Ô¶¨Òå±êÇ©µÄÒ»ÖÖ·½·¨£º
1.дһ¸öÀà¼Ì³ÐTagSupport»òÆäËûTagµÄʵÏÖÀà¡£
public class AllTag extends TagSupport {
@Override
public int doStartTag() throws JspException {
JspWriter out = pageContext.getOut();
try {
out.append("Hello World.");
} catch (IOException e) {
e.pri ......
ServletÈý¸öÒªËØ:
1.±ØÐë¼Ì³Ð×ÔHttpServlet
2.±ØÐëʵÏÖdoGet()»òÕßdoPost()
3.±ØÐëÔÚweb.xmlÖÐÅäÖÃServlet
<servlet>
<servlet-name> </servlet-name>
<servlet-class> </servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> </servlet-nam ......
ÔÚJava web¿ª·¢Öг£»áʹÓõ½¹¦ÄÜÇ¿´óµÄ¹ýÂËÆ÷£¬Ëû±Ï¾¹ÄܸøÎÒÃÇ´øÀ´ºÜ´óµÄ·½±ã£¬µ«ÊÇÕë¶Ô¹ýÂ˵Ä×ÊÔ´ÎÒÃÇÐèÒªÏêϸµÄÁ˽âËûÃÇÔÚweb.xmlÖеÄÅäÖÃÐÅÏ¢¡£Õâ¸ö¸ù¾Ý¼¸ÖÖ³£ÓõIJ»Í¬Çé¿ö½øÐÐÁË×ܽ᣺
1¡£Èç¹ûÒªÓ³Éä¹ýÂËÓ¦ÓóÌÐòÖÐËùÓÐ×ÊÔ´£º
<filter>
<filter-name>loggerfilter</filter-name>
<f ......