Skip to main content
Tweeted twitter.com/#!/StackTridion/status/394489069964890112
added 14 characters in body
Source Link
user348
user348

Update 3 (2013-10-23):

Still too do: tryReconfigured to publish the DCP's to the filesystem, same result. JSP code (above) displays HTML and testunexecuted Javacode.

I ask myself, but thisif there is not preferred since the TCM ID's are retrieved from the Bro DB using the Query object. Prefer to have everything from the DBconfiguration missing, not half DB and half FS becauseone that instructs Tridion to use a JSP CP class instead of some undocumented issue or wrongly implementationa plan CP class impl.

Still too do: try to publish the DCP's to the filesystem, and test, but this is not preferred since the TCM ID's are retrieved from the Bro DB using the Query object. Prefer to have everything from the DB, not half DB and half FS because of some undocumented issue or wrongly implementation.

Update 3 (2013-10-23):

Reconfigured to publish the DCP's to the filesystem, same result. JSP code (above) displays HTML and unexecuted Javacode.

I ask myself, if there is configuration missing, one that instructs Tridion to use a JSP CP class instead of a plan CP class impl.

added 619 characters in body
Source Link
user348
user348

Both the ComponentPresentationAssembler classes from the com.tridion.dynamiccontent package, or the deprecated com.tridion.web.jsp package return the content of the dynmamic component presentation as-is, i.e. without the executed Java code. The Java code is displayed in the HTML source.

Example code from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.web.jsp.ComponentPresentationAssembler webAssembler = 
    new com.tridion.web.jsp.ComponentPresentationAssembler(webPage);

String title = webAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = webAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");
%>

Example code (2) from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.dynamiccontent.ComponentPresentationAssembler dynamicAssembler = 
    new com.tridion.dynamiccontent.ComponentPresentationAssembler(webPage);

String title = dynamicAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = dynamicAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");

// poging 2
dynamicAssembler = new com.tridion.dynamiccontent.ComponentPresentationAssembler(
    "tcm:0-127-1", application, request, response);
%>

The HTML source displays the content of the componentpresentation as well as the Java code from the template itself.

Tridion 2011 SP1 is used together with Tomcat and a working/configured Content Delivery. Publication target language is set to JSP. Dynamic Component Template has checked "Allow on Page Using Dynamic Assembly".

Logfiles doesn't show any warnings or errors except:

2013-10-21 12:18:24,625 WARN Admin - WAI: Could not find a presentation for SiteIdentifier[Protocol=http; Domain=localhost; Port=8080; Path=/tridion.jsp]

Update

DCP's are indeed stored in a broker database (Oracle)

Update 2

Both Publication target and Template Output is set to REL. Unpublished the templates, checked that no CP's are in DB. Republished the templates, but CP's still display Java code.

Added the TLD stuff as suggested below, restarted Tomcat, but same problem. CP's still display unexecuted Java code.

Still too do: try to publish the DCP's to the filesystem, and test, but this is not preferred since the TCM ID's are retrieved from the Bro DB using the Query object. Prefer to have everything from the DB, not half DB and half FS because of some undocumented issue or wrongly implementation.

Both the ComponentPresentationAssembler classes from the com.tridion.dynamiccontent package, or the deprecated com.tridion.web.jsp package return the content of the dynmamic component presentation as-is, i.e. without the executed Java code. The Java code is displayed in the HTML source.

Example code from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.web.jsp.ComponentPresentationAssembler webAssembler = 
    new com.tridion.web.jsp.ComponentPresentationAssembler(webPage);

String title = webAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = webAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");
%>

Example code (2) from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.dynamiccontent.ComponentPresentationAssembler dynamicAssembler = 
    new com.tridion.dynamiccontent.ComponentPresentationAssembler(webPage);

String title = dynamicAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = dynamicAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");

// poging 2
dynamicAssembler = new com.tridion.dynamiccontent.ComponentPresentationAssembler(
    "tcm:0-127-1", application, request, response);
%>

The HTML source displays the content of the componentpresentation as well as the Java code from the template itself.

Tridion 2011 SP1 is used together with Tomcat and a working/configured Content Delivery. Publication target language is set to JSP. Dynamic Component Template has checked "Allow on Page Using Dynamic Assembly".

Logfiles doesn't show any warnings or errors except:

2013-10-21 12:18:24,625 WARN Admin - WAI: Could not find a presentation for SiteIdentifier[Protocol=http; Domain=localhost; Port=8080; Path=/tridion.jsp]

Update

DCP's are indeed stored in a broker database (Oracle)

Both the ComponentPresentationAssembler classes from the com.tridion.dynamiccontent package, or the deprecated com.tridion.web.jsp package return the content of the dynmamic component presentation as-is, i.e. without the executed Java code. The Java code is displayed in the HTML source.

Example code from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.web.jsp.ComponentPresentationAssembler webAssembler = 
    new com.tridion.web.jsp.ComponentPresentationAssembler(webPage);

String title = webAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = webAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");
%>

Example code (2) from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.dynamiccontent.ComponentPresentationAssembler dynamicAssembler = 
    new com.tridion.dynamiccontent.ComponentPresentationAssembler(webPage);

String title = dynamicAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = dynamicAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");

// poging 2
dynamicAssembler = new com.tridion.dynamiccontent.ComponentPresentationAssembler(
    "tcm:0-127-1", application, request, response);
%>

The HTML source displays the content of the componentpresentation as well as the Java code from the template itself.

Tridion 2011 SP1 is used together with Tomcat and a working/configured Content Delivery. Publication target language is set to JSP. Dynamic Component Template has checked "Allow on Page Using Dynamic Assembly".

Logfiles doesn't show any warnings or errors except:

2013-10-21 12:18:24,625 WARN Admin - WAI: Could not find a presentation for SiteIdentifier[Protocol=http; Domain=localhost; Port=8080; Path=/tridion.jsp]

Update

DCP's are indeed stored in a broker database (Oracle)

Update 2

Both Publication target and Template Output is set to REL. Unpublished the templates, checked that no CP's are in DB. Republished the templates, but CP's still display Java code.

Added the TLD stuff as suggested below, restarted Tomcat, but same problem. CP's still display unexecuted Java code.

Still too do: try to publish the DCP's to the filesystem, and test, but this is not preferred since the TCM ID's are retrieved from the Bro DB using the Query object. Prefer to have everything from the DB, not half DB and half FS because of some undocumented issue or wrongly implementation.

improved readability via a small cleanup
Source Link
Bart Koopman
  • 29.6k
  • 3
  • 40
  • 90

Both the ComponentPresentationAssemblerComponentPresentationAssembler classes from the com.tridion.dynamiccontentcom.tridion.dynamiccontent package, or the deprecated com.tridion.web.jspcom.tridion.web.jsp package return the content of the dynmamic component presentation as-is, i.e. without the executed Java code. The Java code is displaydisplayed in the HTML source.

Example code from a test.jsptest.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.web.jsp.ComponentPresentationAssembler webAssembler = 
    new com.tridion.web.jsp.ComponentPresentationAssembler(webPage);

String title = webAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = webAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");
%>
<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.web.jsp.ComponentPresentationAssembler webAssembler = 
    new com.tridion.web.jsp.ComponentPresentationAssembler(webPage);

String title = webAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = webAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");
%>

Example code (2) from a test.jsptest.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.dynamiccontent.ComponentPresentationAssembler dynamicAssembler = 
    new com.tridion.dynamiccontent.ComponentPresentationAssembler(webPage);

String title = dynamicAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = dynamicAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");

// poging 2
dynamicAssembler = new com.tridion.dynamiccontent.ComponentPresentationAssembler(
    "tcm:0-127-1", application, request, response);

%>

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.dynamiccontent.ComponentPresentationAssembler dynamicAssembler = 
    new com.tridion.dynamiccontent.ComponentPresentationAssembler(webPage);

String title = dynamicAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = dynamicAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");

// poging 2
dynamicAssembler = new com.tridion.dynamiccontent.ComponentPresentationAssembler(
    "tcm:0-127-1", application, request, response);
%>
2013-10-21 12:18:24,625 WARN  Admin - WAI: Could not find a presentation for SiteIdentifier[Protocol=http; Domain=localhost; Port=8080; Path=/tridion.jsp]

2013-10-21 12:18:24,625 WARN Admin - WAI: Could not find a presentation for SiteIdentifier[Protocol=http; Domain=localhost; Port=8080; Path=/tridion.jsp]

Update

Edit 1: DCP's are indeed stored in a broker database (Oracle)

Both the ComponentPresentationAssembler classes from the com.tridion.dynamiccontent package, or the deprecated com.tridion.web.jsp package return the content of the dynmamic component presentation as-is, i.e. without the executed Java code. The Java code is display in the HTML source.

Example code from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.web.jsp.ComponentPresentationAssembler webAssembler = 
    new com.tridion.web.jsp.ComponentPresentationAssembler(webPage);

String title = webAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = webAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");
%>

Example code (2) from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.dynamiccontent.ComponentPresentationAssembler dynamicAssembler = 
    new com.tridion.dynamiccontent.ComponentPresentationAssembler(webPage);

String title = dynamicAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = dynamicAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");

// poging 2
dynamicAssembler = new com.tridion.dynamiccontent.ComponentPresentationAssembler(
    "tcm:0-127-1", application, request, response);

%>

2013-10-21 12:18:24,625 WARN  Admin - WAI: Could not find a presentation for SiteIdentifier[Protocol=http; Domain=localhost; Port=8080; Path=/tridion.jsp]

Edit 1: DCP's are indeed stored in a broker database (Oracle)

Both the ComponentPresentationAssembler classes from the com.tridion.dynamiccontent package, or the deprecated com.tridion.web.jsp package return the content of the dynmamic component presentation as-is, i.e. without the executed Java code. The Java code is displayed in the HTML source.

Example code from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.web.jsp.ComponentPresentationAssembler webAssembler = 
    new com.tridion.web.jsp.ComponentPresentationAssembler(webPage);

String title = webAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = webAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");
%>

Example code (2) from a test.jsp page:

<%
com.tridion.web.jsp.JSPPage webPage = 
    new com.tridion.web.jsp.JSPPage(pageContext, "tcm:127-243236-64");
    
com.tridion.dynamiccontent.ComponentPresentationAssembler dynamicAssembler = 
    new com.tridion.dynamiccontent.ComponentPresentationAssembler(webPage);

String title = dynamicAssembler.getContent(455985, 243136);
out.print("Title = " + title + "<br>");

String content = dynamicAssembler.getContent("tcm:127-455985", "tcm:127-243135-32");
out.print("Content = " + content + "<br>");

// poging 2
dynamicAssembler = new com.tridion.dynamiccontent.ComponentPresentationAssembler(
    "tcm:0-127-1", application, request, response);
%>

2013-10-21 12:18:24,625 WARN Admin - WAI: Could not find a presentation for SiteIdentifier[Protocol=http; Domain=localhost; Port=8080; Path=/tridion.jsp]

Update

DCP's are indeed stored in a broker database (Oracle)

Added broker database
Source Link
user348
user348
Loading
Source Link
user348
user348
Loading