Jsp ELÓï·¨
Jsp ELÓï·¨
Àý£º
${sessionScope.user.sex}
ËùÓÐEL¶¼ÊÇÒÔ ${ ΪÆðʼ¡¢ÒÔ} Ϊ½áβµÄ¡£
ÉÏÊöEL·¶ÀýµÄÒâ˼ÊÇ£º´ÓSessionÈ¡µÃÓû§µÄÐÔ±ð¡£Èç¹ûʹÓÃ֮ǰJSP´úÂëµÄд·¨ÈçÏ£º
<%
User user = (User)session.getAttribute(”user”);
String sex = user.getSex( );
%>
Á½ÕßÏà±È½Ï֮ϣ¬¿ÉÒÔ·¢ÏÖELµÄÓï·¨±È´«Í³JSP´úÂë¸üΪ·½±ã¡¢¼ò½à¡£
ELÌṩ . ºÍ [ ] Á½ÖÖÔËËã·ûÀ´´æÈ¡Êý¾Ý£¬[ ]¿ÉÒÔ·ÃÎʼ¯ºÏ»òÕßÊÇÊý×éµÄÔªËØ¡¢BeanµÄÊôÐÔ¡£
ÏÂÁÐÁ½ÕßËù´ú±íµÄÒâ˼ÊÇÒ»ÑùµÄ£¬µ«ÊÇÐèÒª±£Ö¤ÒªÈ¡µÃ¶ÔÏóµÄÄǸöµÄÊôÐÔÓÐÏàÓ¦µÄsetXxx()ºÍgetXxx()·½·¨²ÅÐС£
Àý£º
${sessionScope.user.sex}
µÈÓÚ ${sessionScope.user["sex"]}
. ºÍ [ ] Ò²¿ÉÒÔͬʱ»ìºÏʹÓã¬ÈçÏ£º
${sessionScope.shoppingCart[0].price}
·µ»Ø½á¹ûΪshoppingCartÖеÚÒ»ÏîÎïÆ·µÄ¼Û¸ñ¡£
ÔÚELÖУ¬×Ö·û´®¼È¿ÉÒÔʹÓÔabc”£¬¿ÉÒÔʹÓÃ’abc’¡£
ELÔËËã·û
ELµÄËãÊõÔËËã·ûºÍJavaÖеÄÔËËã·ûµÄ´óÖÂÏàͬ£¬ÓÅÏȼ¶Ò²Ïàͬ¡£
×¢Ò⣺’+’ ÔËËã·û²»»áÁ¬½Ó×Ö·û´®ÁË£¬ËûÖ»ÓÃÓÚ¼Ó·¨ÔËËã¡£
EL¹ØÏµÔËËã·ûÓÐÒÔÏÂÁù¸öÔËËã·û
¹ØÏµÔËËã·û ˵ Ã÷ ·¶ Àý ½á¹û
= = »ò eq | µÈÓÚ |${ 5 = = 5 } »ò ${ 5 eq 5 } | true
!= »ò ne | ²»µÈÓÚ |${ 5 != 5 } »ò ${ 5 ne 5 } | false
< »ò lt | СÓÚ |${ 3 < 5 }»ò ${ 3 lt 5 } | true
> »ò gt | ´óÓÚ |${ 3 > 5 }»ò ${ 3 gt 5 } | false
<= »ò le | СÓÚµÈÓÚ |${ 3 <= 5 }»ò ${ 3 le 5 } | true
>= »ò ge | ´óÓÚµÈÓÚ |${ 3 >= 5 }»ò ${ 3 ge 5 } | false
emptyÔËËã·û
EmptyÔËËã·ûÖ÷ÒªÓÃÀ´ÅжÏÖµÊÇ·ñΪnull»ò¿ÕµÄ£¬ÀýÈ磺
${ empty param.name }
½ÓÏÂÀ´ËµÃ÷EmptyÔËËã·ûµÄ¹æÔò£º
{empty} A
Èç¹ûAΪnullʱ£¬·µ»Øtrue
Èç¹ûA²»´æÔÚʱ£¬·µ»Øtrue
Èç¹ûAΪ¿Õ×Ö·û´®Ê±£¬·µ»Øtrue
Èç¹ûAΪ¿ÕÊý×é
Ïà¹ØÎĵµ£º
http://www.soft6.com/tech/16/160477.html
ʵÏÖtagµÄÀࣨ±êÇ©´¦ÀíÆ÷£©(tag handler)
1£¬ÊÇһЩÔÚÒýÓÃÁ˱êÇ©µÄJSPÒ³ÃæÖ´ÐÐÆÚ¼ä±»Web Containerµ÷ÓÃÒÔÇó×Ô¶¨Òå±êǩֵµÄ¶ÔÏó;
2£¬±ØÐëʵÏÖTag, SimpleTagºÍBodyTagÖ®Ò»
3£¬¿ÉÒԼ̳ÐTagSupportºÍBodyTagSupportÖ®Ò»
±êÇ©¿âµÄ½Ó¿ÚºÍÀàµÄ¼Ì³Ð¹ØÏµ½Ó¿ÚµÄ¼Ì³Ð¹ØÏµ£º  ......
֮ǰ,д¹ýÒ»¸öDownload.jspÎļþ,Äܽâ¾öÏÂÔØÎļþÂÒÂëÎÊÌâ(ÖîÈç:DOC,XSLÎļþµÈµÈ).
ºóÀ´·¢ÏÖ,Óö¼ûÖÐÎÄÃûµÄÎļþµÄʱºò,ÎļþÏÂÔØ½«»á±¨´í~~~~
½ñÌì,ͨ¹ý¸ÄдÔDownload.jspÎļþÒÑÍêÈ«½â¾öÁËÕâ¸öÎÊÌâ~
Ŀǰ,°ÑÒ»ÕûÌ×µÄÎļþÉÏ´«ÏÂÔØµÄ·½·¨¸øÌù³öÀ´~~~ÒÔ±ã´ó¼Ò½è¼ø!~!~!~!~!
×÷Õß:¹Å°£¼°·¨ÀÏ
------------------------ ......
this.state="01";ͨ³£µÄ×ö·¨ÊÇдһ¸öÀࣨ½Ó¿Ú£©À´´æ·Å³£Á¿
public interface MyConstant
{
public static final String STATE_01= "01";
}
È»ºóÔÚ³ÌÐòÖÐÕâÑùд¾Í¿ÉÒÔÁË
this.state=MyConstant.STATE_01;
ÔÚJava³ÌÐòÖÐÕâÑù¾Í¿ÉÒÔ±ÜÃâÓ²±àÂëÁË¡£¿ÉÊÇJSPÖÐÄØ£¿µ±È»£¬Èç¹ûJSPÖÐÔÊÐíʹÓÃScripletµÄ»°µ±È»Ò²¿ÉÒÔÖ±½ÓʹÓó ......
Ò»¸öÏîÄ¿ÖлáÔÚ¶à¸öJSP½çÃæÖÐʹÓÃÏÂÀ¿ò£¬ÈÕÆÚ¿Ø¼þ£¬·ÖÒ³¿Ø¼þ¡£ÈôÄܽ«´ËÀà¿Ø¼þ³éÏó³öÀ´£¬×ö³ÉÒ»¸öJspTagµÄ»°£¬ÄÇʹÓÃÆðÀ´¾Í·½±ã¶àÁË¡£Í¬Ê±±ãÓÚJSPµÄÔĶÁ£¬¸üÖ÷ÒªµÄÊÇ·½±ãÁËÏîÄ¿µÄ¹ÜÀíÓëά»¤¡£
ÏÂÃæÒÔÐÐÒµÏÂÀ¿ò¿Ø¼þΪÀý½éÉÜ×Ô¶¨ÒåJspTag£¬ÓÈÆä×¢ÒâºìÉ«±ê×¢´¦£¬´Ó¶ÔÓ¦¹ØÏµ¿ÉÒÔÕÒµ½ÔËÓùæÂÉ£º
Ê×ÏȽ¨Á¢/WEB-INF/tags/my-t ......
¡¡¡¡¸÷´óÍøÂç±à³ÌÓïÑÔµÄ10Äê·ÜÕ½£¬¸÷ÓÐËù³¤¡¢¸÷ÁìǧÇï¡£½ñÈÕ¶ÔÓÚÎÒÃǵÄÍøÕ¾±à³ÌÓïÑÔ:ASP¡¢JSP¡¢PHP¡¢ASP.NET½øÐÐʵ¼ÊÓ¦ÓÃͳ¼Æ:
¡¡¡¡ASP:50%
¡¡¡¡JSP:10%
¡¡¡¡PHP:20%
¡¡¡¡ASP.NET:20%
¡¡¡¡¸ù¾ÝÒÔÉÏͳ¼ÆÀ´×öÒ»ÏÂÌÖÂÛ¡£ASP¼¼ÊõÈç½ñÌì¿ÉÒÔ˵ÒѳÉΪ¹ýÈ¥£¬µ«ÈÔÕ¼Êг¡µÄ50%£¬ÒòΪµ±Ê±ASP¼¼ÊõµÄÐËÆð£¬¶Ô´ó²¿·Ö±à³Ì ......