[opencms-dev] Problem with cms:enable-ade inside included jsp.file

John Bieling john.bieling at gmx.de
Fri Jul 1 11:41:15 CEST 2016


Hi,

my template.jsp includes another jsp which is using <cms:enable-ade />. 
So basically:

template.jsp:
------------------------

<%@page buffer="none" session="true" trimDirectiveWhitespaces="true" 
import="org.opencms.jsp.CmsJspActionElement, org.opencms.file.CmsObject" %>
<%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%

     CmsJspActionElement cms = new CmsJspActionElement(pageContext, 
request, response);
     CmsObject cmsObject = cms.getCmsObject();

... some session stuff ...

  cms.include("other.jsp");

%>



other.jsp:
-------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
     <cms:enable-ade />
</head>

<body>
    Stuff
</body>
</html>


What happens: The generated code of the enable-ade is placed before the 
DOCTYPE definition at the very top. This breaks some css things.

If I change the code, so everything happens inside template.jsp, the 
generated code of the enable-ade is placed inside head.

Is there anything I can do to get it working using the include?


Thanks
John




More information about the opencms-dev mailing list