首页 > Web开发 > 详细

JSP EL表达式忽略方法

时间:2015-10-20 13:54:20      阅读:607      评论:0      收藏:0      [点我收藏+]

JSP EL表达式忽略方法:

web.xml中,和jsp中;jsp中的等级要高一些;

web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID"
    version="3.0">
    <display-name>TestBootWeb</display-name>
    <jsp-config>
        <jsp-property-group>
            <url-pattern>*.jsp</url-pattern>
            <el-ignored>false</el-ignored>
        </jsp-property-group>
    </jsp-config>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

 

jsp:

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="true"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    pageContext.setAttribute("pca", "pageContextAttribute");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>008index</title>
</head>
<body>
    EL result is :
    <p>${pageScope.pca }</p>
</body>
</html>

 

JSP EL表达式忽略方法

原文:http://www.cnblogs.com/stono/p/4894421.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!