JSP---web.xml

本文介绍了JSPEL的支持情况及其与JSP版本的关系,指出JSPEL仅支持JSP 2.0及以上版本,并解释了如何在web.xml中声明正确的servlet版本来启用EL表达式。此外,还提供了正确链接外部样式表和JavaScript文件的方法。
1. JSP EL just support by JSP2.0 or above, the servlet 2.3 works for JSP1.2. If we want to use EL in JSP page, we should declare the version of servlet  as 2.4 in web.xml.
  <!DOCTYPE web-app PUBLIC
    "-//Sun Microsystems, Inc.//DTD Web Application 2.4//EN"
    "http://java.sun.com/dtd/web-app_2_4.dtd">
<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">

2. If we want refer to a external style sheet or javascript file, the correct link form is:
    <link type="text/css" rel="stylesheet" href="pages/css/common.css">
    Remember: there is NOT a slash at the beginning of URI.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值