Topic: EL无效表达的问题?很老的问题?

  Print this page

1.EL无效表达的问题?很老的问题? Copy to clipboard
Posted by: yeafee
Posted on: 2005-12-23 12:04

真是郁闷呀,一个EL的问题困挠了我半天还搞不出来,先是从别处看到文档说页头要加下面的代码;

<%@page isELIgnored="false" %>

加了,一样的EL表达没有起效.又说web.xml的头部要换成下面这样的/

<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">

于是又换成上面的表头,问题仍没有解决呀!Sad, 干脆点,把Tomcat从5.0.12升到
Tomcat5.5.12,因为我的jdk是
java version "1.4.2_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05)
Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)

所以,新的V5.5.12Tomcat无法启动,看提示:要兼容包,
所以,又从Apache下载了兼容包.Tomcat很快的启动了,可以看到小猫了,也能进到我的程序,可是EL问题仍没有解决.

hello.jsp代码如下了.
<%@page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<HTML>
<HEAD><TITLE>Admin</TITLE></HEAD>
<BODY>
<H1>Simple hard coded destination page</H1>
<P>Hello, <c:out value="$(user)"/>, time is <c:out value="$(now)"/>.</P>
</BODY>
</HTML>


IE中显示为;
Hello, $(user), time is $(now).

大家来救火呀,Smile有没有通用的办法呢?可能彻底的解决如此问题???

2.Re:EL无效表达的问题?很老的问题? [Re: yeafee] Copy to clipboard
Posted by: jimmy14
Posted on: 2005-12-23 13:31

try this (Tomcat 5.5, JDK1.5)

<%@page isELIgnored="true" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<HTML>
<HEAD><TITLE>Admin</TITLE></HEAD>
<BODY>
<H1>Simple hard coded destination page</H1>
<P>Hello, your host is <c:out value="${header['host']}"/></P>
</BODY>
</HTML>

3.Re:EL无效表达的问题?很老的问题? [Re: yeafee] Copy to clipboard
Posted by: yeafee
Posted on: 2005-12-23 14:12

还是不行哦,lib里的jstl.jar,standard.jar 也换成最新了,还是不行啊.

4.Re:EL无效表达的问题?很老的问题? [Re: yeafee] Copy to clipboard
Posted by: yeafee
Posted on: 2005-12-23 14:40

好了,可以不加这个的,
<%@page isELIgnored="false" %>


注意红色部份,2.3同2.4 不同
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<HTML>
<HEAD><TITLE>Admin</TITLE></HEAD>
<BODY>
<H1>Simple hard coded destination page</H1>
<P>Hello,<c:out value="${username}"/>,
Now time is:<c:out value="${nowtime}"/></P>
<P>Hello, your host is <c:out value="${header['host']}"/></P>
</BODY>
</HTML>


Simple hard coded destination page
Hello,Spring user, Now time is:Fri Dec 23 14:45:57 CST 2005

Hello, your host is localhost

5.Re:EL无效表达的问题?很老的问题? [Re: yeafee] Copy to clipboard
Posted by: wangzt
Posted on: 2005-12-26 18:52

以前好像是把
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
改为
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
来做的,你也可以试一下


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923