[MAGNOLIA-4001] incorrect jsp component rendering Created: 05/Mar/12  Updated: 08/Mar/12  Resolved: 06/Mar/12

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 4.5
Fix Version/s: 4.5.1

Type: Bug Priority: Blocker
Reporter: Igor Klimchynski Assignee: Eric Hechinger
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive SCRUM-1086.zip     XML File config.modules.templating.xml     Zip Archive templates.zip     XML File website.ftlPage1.xml    
Issue Links:
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

info.magnolia.rendering.renderer.JspRenderer doesn't finish rendering a jsp component correctly. A as a result containing page rendering is not complete.



 Comments   
Comment by Philipp Bärfuss [ 05/Mar/12 ]

Thanks for the report. Do you have more details? Are characters missing, ...

Comment by Philipp Bärfuss [ 05/Mar/12 ]

For the moment we are going to re-test our JSP samples

Comment by Eric Hechinger [ 05/Mar/12 ]

After testing this module I got the following Exception:

@Igor: Did you get the same exception?

UI:
Error while rendering [/jsp-sample-site] with template [samples:pages/jsp/main]: RenderException: Can't render template /templates/samples/pages/main.jsp

SERVER LOG:
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /templates/samples/pages/main.jsp(55,11) The function decode must be used with a prefix when a default namespace is not specified
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)

Comment by Eric Hechinger [ 05/Mar/12 ]

This issue seems to be related to SCRUM-1086.
Have to wait the confirmation of the reporter to also close this isse.

Comment by Igor Klimchynski [ 05/Mar/12 ]

No, I did not get any exception. That was a silent error.
I followed the tutorial http://documentation.magnolia-cms.com/templates/introduction.html and created an ftl page and added jsp and ftl components to it. The ftl component was displayed with no problem. However, the page rendering was not completed when I added the jsp component. I observed the same behavior when I tried to add the jsp component to the demo project (demo-project).

Comment by Eric Hechinger [ 05/Mar/12 ]

@Igor

Could you please add/past your JSP code?

Comment by Eric Hechinger [ 05/Mar/12 ]

Remember, the syntax in JSP changed from 4.4 to 4.5. For example (based on the tutorial)

<%@ taglib uri="cms-taglib" prefix="cms" %>

will now be

<%@ taglib prefix="cms" uri="http://magnolia-cms.com/taglib/templating-components/cms"%>
<html>
<head>
<cms:init/>
<title>${content.title}</title>
</head>
<body>
<h1>${content.title}</h1>
<p>My template content</p>
</body>
</html>

And this is working. Could you just verify?
Thanks

Comment by Igor Klimchynski [ 06/Mar/12 ]

Please see the attached files.

Comment by Igor Klimchynski [ 06/Mar/12 ]

1. templates.zip contains the template directory /<CATALINA_HOME>/webapps/<contextPath>/templates
2. config.modules.templating.xml - page and component templates
3. website.ftlPage1.xml - a test website

Comment by Igor Klimchynski [ 06/Mar/12 ]

The proposed template for a jsp page did not work in my test setup. I did not find an jsp component example on the tutorial page http://documentation.magnolia-cms.com/templates/introduction.html

Comment by Igor Klimchynski [ 06/Mar/12 ]

In the attached files I tried to add a jsp component to an ftl page.

Comment by Eric Hechinger [ 06/Mar/12 ]

Dear Igor.

We currently face an issue displaying JSP and FTL components in an ftl area. This will be solved in the next main release.
I also attached your example, a little bit modified, so you will have a JSP example.

If you need better JSP examples, you can add to Magnolia the magnolia-templating-sample (two equivalent sites one in JSP one in FTL).

Regards

Comment by Eric Hechinger [ 06/Mar/12 ]

Modified example

Comment by Eric Hechinger [ 06/Mar/12 ]

Modification of the JSP renderer.
Now, if the current rendered content is not the main content (one of his chields) the rendering result is included and no more forwarded.

Generated at Mon Feb 12 03:51:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.