[opencms-dev] EL and OpenCMS macros

Scott Shealy spshealy at graysail.com
Wed Nov 30 18:36:14 CET 2005


All,

I am having a problem that I hope somebody can help with.  I currently
have a client who has a very large site that is developed and running on
6 alpha 3.  We are trying to migrate them to 6.03 / 6.02.  But I am
having a problem with their xml content pages and the interaction with
jsp2.0/jstl1.1 and the macroresolver in xmlcontent.

Basically I have a jsp that is trying to render xmlcontent and it has
the following fragment in it

<%@ page language="java" session="true"%>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ taglib prefix="gto" uri="/WEB-INF/customtaglib.tld" %>
<cms:contentload collector="singleFile" param="${opencms.uri}"
editable="true">

I am using 6.02 in tomcat 5.0.28 and I have changed the web.xml back to
the 2.4 spec so it I can use jsp2.0 and jstl 1.1.

The problem with the above fragment is that the jsp compiler interprets
the opencms macro 

${opencms.uri} 

in 

param="${opencms.uri}" 

as an el expression. When the page gets called I get a runtime error
that says the attribute param does not except expressions according to
the tld.  In alpha3 this was not a problem because the syntax was
opencms:uri(which bring up the interesting question of why the syntax
was changed to something that is exactly like el?  maybe I am missing
something here) which is not interpreted as el.  Obviously one solution
is to this is to turn off el for the page with a directive.. but later
in many of my pages I have el.  I also thought I could escape the el
like this:

param="\${opencms.uri}"

but that is not working as expected.  While it does not get interpreted
as el the cms:contentload tag does not receive the value ${opencms.uri}.
After some debugging I determined that it is receiving the value
^[{opencms.uri}.. where ^[ is an unprintable ascii character.

Does anyone have any ideas what is going on here or have a workaround?

TIA,
Scott Shealy







More information about the opencms-dev mailing list