[opencms-dev] JSP2 issue escaping EL expressions in cms:contentload

Stefan Uldum Grinsted stefan at e-nation.dk
Wed Sep 20 14:25:43 CEST 2006


Hi all

 

Last year, 30 November 2005 17:36, Scott Shealy asked the list about an
issue with using the "${opencms.uri}" parameter for <cms:contentload /> in a
JSP2 environment. And I have the same issue. Did anyone ever find a
resolution for this?

 

The default way to escape the EL resolver is to use \${.} and that work
great in all other tag libs, even in my own. But when I pass
"\${opencms.uri} to the param attribute of cms:contentload, the generated
java-code contains a strange character (char 27) in front of {opencms.uri}
rather than the $. The char 27 is the ASCII escape character, but how does
that end up there?

 

I know the directives of the jsp's are treated by opencms, before they are
written to the rfs (where it still looks as expected), but does opencms do
something during java-code generation of the jsp's? - Because that's where
it seems to go wrong.

 

If I have the following two lines next to each other in a jsp:

 

            <c:out value="\${opencms.uri}" />

            <cms:contentload collector="singleFile" param="\${opencms.uri}"
editable="true">

 

The java-generated code for the two lines looks like this:

 

    //  c:out

    org.apache.taglibs.standard.tag.rt.core.OutTag _jspx_th_c_out_0 =
(org.apache.taglibs.standard.tag.rt.core.OutTag)
_jspx_tagPool_c_out_value_nobody.get(org.apache.taglibs.standard.tag.rt.core
.OutTag.class);

    _jspx_th_c_out_0.setPageContext(_jspx_page_context);

    _jspx_th_c_out_0.setParent(null);

    _jspx_th_c_out_0.setValue(new String("${opencms.uri}"));

 

/* snip */

 

    //  cms:contentload

    org.opencms.jsp.CmsJspTagContentLoad _jspx_th_cms_contentload_0 =
(org.opencms.jsp.CmsJspTagContentLoad)
_jspx_tagPool_cms_contentload_param_editable_collector.get(org.opencms.jsp.C
msJspTagContentLoad.class);

    _jspx_th_cms_contentload_0.setPageContext(_jspx_page_context);

    _jspx_th_cms_contentload_0.setParent((javax.servlet.jsp.tagext.Tag)
_jspx_th_c_catch_0);

    _jspx_th_cms_contentload_0.setCollector("singleFile");

    _jspx_th_cms_contentload_0.setParam("{opencms.uri}");

    _jspx_th_cms_contentload_0.setEditable("true");

 

 

Here you see the strange non-readable ASCII escape char in front of the
opencms.uri for cms:contentload but not for c:out, which really puzzles me.

 

Does anyone have any resolutions or suggestions? any leads?  Anything? 

 

Thanx in advance.

/ Stefan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060920/79363849/attachment.htm>


More information about the opencms-dev mailing list