[opencms-dev] Re: JSTL Expression Language and OpenCms Macro Excpressions
Fabian Huber
fabian.huber at gmail.com
Sun Aug 13 17:52:45 CEST 2006
Hello Toni,
* Yes, I reverted all my changes in the web.xml file.
* The start tag in the web.xml file is:
<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">
* The jsp where the problem exists, doesn't use any taglib. The problem is,
when I try to use OpenCms Macro Expressions. Here is an example:
<%@ page session="false" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<jsp:useBean id="cms" class="org.opencms.jsp.CmsJspActionElement">
<link rel="stylesheet" type="text/css"
href="sites/default/kljb/css/articlemodule.css">
<%
cms.init(pageContext, request, response);
// get the template
String template = cms.property("template", "search");
// The page header
cms.include(template, "head");
// end of template head
String number = "${number}";
%>
<h1> Gallery</h1>
<cms:contentload collector="allInFolderDateReleasedDesc"
param="/kljb/gallery/photos/galery_${number}|photoalbum" editable="true">
<table border="0" width="100%">
<tr><td width="50%">
<h2><cms:contentshow element="Title" /></h2>
</td>
<td>
<cms:contentloop element="Thumbs">
<cms:contentshow element="TextBottom" />
</cms:contentloop>
</td>
</tr>
<tr>
<td>
<cms:contentloop element="Thumbs">
<cms:contentshow element="TextTop" />
</cms:contentloop>
</td>
<td>
<a href="<cms:link><cms:contentshow element="${opencms.filename}"
/></cms:link>">Ansehen</a>
</td>
</tr>
</table>
<br/><br/>
</cms:contentload>
<%
// The page foot
cms.include(template, "foot");
%>
</jsp:useBean>
The JSTL Library is parsing this file and takes the parts underlined as
Expression Language. In fact, these parts are OpenCms Macro. Both languages
have the same syntax. So this is the problem. (I don't know, why the OpenCms
developers decided to take the syntax of Expression Language for Macro
Expression, too. Ist there any sense?)
You are working with macros in your jsp files and don't get this problem?
Regards,
Fabian
2006/8/13, Toni PĂ©rez <tp.ocms at gmail.com>:
>
> On 13/08/06, Fabian Huber <fabian.huber at gmail.com> wrote:
> > Hello Toni,
> >
> > thanks for your answer.
> > I used JSTL 1.1. After your answer, I tried to use version 1.0.6. But
> the
> > problem was the same. Which version of OpenCms do you use?
> >
> > Regards,
> > Fabian
>
>
> Hello, Fabian.
>
>
> I am using OpenCms 6.2.1 on a Tomcat 5.5, but I think it would also
> works with 6.0.
>
> Some questions to try to know what is happening:
>
> * Have you reverted the changes done on the "web.xml" to use the JSTL 1.1?
>
> * The start tag of "webapp" element in the "web.xml" file:
> is simply "<web-app>"?
> Or is <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">?
>
> * In the JSP (i will use the core taglib for example):
> are you declaring the taglib with <%@ taglib prefix="c"
> uri="http://java.sun.com/jstl/core" %>?
> or with <%@ taglib prefix="c"
> uri="http://java.sun.com/jsp/jstl/core" %>? (note the "jsp/" substring
> after "java.sun.com")
>
>
> Regards.
> Toni.
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060813/968ae6a8/attachment.htm>
More information about the opencms-dev
mailing list