alkacon / opencms-core

The Java open source content management system by Alkacon Software
http://www.opencms.org
GNU Lesser General Public License v2.1
528 stars 575 forks source link

Different behavior of the c Tag between version 17 and version 18 in OpenCMS #808

Open rgaviras opened 6 days ago

rgaviras commented 6 days ago

Here's a simple example of the issue:

We have a resource with a formatter like this:

<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:redirect url="https://www.google.com"/>

In version 16, if the resource is on a page, the redirect works as expected. However, in version 18, this fails and returns the following error on the page:

Error parsing element /en-en/page/.elements/Banner_00001.xml. Please check if the HTML generated by the element formatter is well formed.

image

To test this, it’s recommended to first create the formatter without the redirect; otherwise, it won't allow you to drag it onto the page, whether it works or not.

This is just a sample to replicate the issue. In the actual case, this code is within a function that performs the redirect based on specific logic.

rgaviras commented 6 days ago

I've tested on OpenCms17 and works as expected... the diference is on version 18

rgaviras commented 6 hours ago

Does anyone know or can think of an alternative to bypass this error? Or any hints on where to look? We're a bit lost, and a large part of our development depends on a method like this.