Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The function getMessageData must be used with a prefix when a default namespace is not specified [duplicate]

Tags:

jsp

tomcat

jstl

el

I am getting this error

/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()}"/>

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

Tomcat version on server is "Tomcat 6.0"

like image 387
Govind Malviya Avatar asked Sep 23 '13 14:09

Govind Malviya


1 Answers

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.

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.

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

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

like image 151
skuntsel Avatar answered Sep 19 '22 16:09

skuntsel