未指定默认名称空间时,必须将函数getMessageData与前缀一起使用 [英] The function getMessageData must be used with a prefix when a default namespace is not specified

查看:91
本文介绍了未指定默认名称空间时,必须将函数getMessageData与前缀一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到此错误

/WEB-INF/jsp/account/index.jsp(6,0)函数getMessageData必须 未指定默认名称空间时,可以与前缀一起使用

/WEB-INF/jsp/account/index.jsp(6,0) The function getMessageData must be used with a prefix when a default namespace is not specified

<c:set var="messageData" scope="session" value="${usermap.getMessageData()}"/>
<c:set var="scheduleData" scope="session" value="${usermap.getScheduleData()}"/>
<c:set var="meetingData" scope="session" value="${usermap.getMeetingData()}"/>

请注意,我可以在本地Tomcat上运行相同的项目,而不会出现任何错误.

Notice that I can run the same project on local Tomcat without any error.

服务器上的Tomcat版本是"Tomcat 6.0"

Tomcat version on server is "Tomcat 6.0"

推荐答案

您的代码存在的问题是,本地运行的代码在Tomcat 7上运行,而服务器上运行的代码在Tomcat 6上运行.

The problem with your code is that the code run locally is run on Tomcat 7 and the code run on the server is run on Tomcat 6.

EL 2.2(及更高版本)的功能是带有参数的方法(那些())的调用,并且它与Servlet 3.0兼容的容器(因此是Tomcat 7)一起运行时,您的代码就可以在本地正常运行.

As soon as invocation of methods with parameters (those ()) is the feature of EL 2.2 (and higher) and it is accompanied by Servlet 3.0 compatible containers (thus Tomcat 7) your code runs fine locally.

在Servlet 2.5容器(因此是Tomcat 6)上运行此代码后,您会遇到上述错误.

As soon as this code is run on a Servlet 2.5 container (thus Tomcat 6) you get the mentioned error.

两个servlet容器仍支持类属性"访问(不带()).

Still, "property-like" access (without ()) is supported by both servlet containers.

这篇关于未指定默认名称空间时,必须将函数getMessageData与前缀一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆