Processing Content in JSP
-------------------------
Key: DOCU-243
URL: http://jira.magnolia-cms.com/browse/DOCU-243
Project: Documentation
Issue Type: New Feature
Security Level: Public
Reporter: Suzanne Deprez
Assignee: Suzanne Deprez
Need to add documentation to describe how content can be processed in JSP.
Christian Ringele included the following response to a question in an E-mail:
User's Question: How can I use the data from the content object in JSP code?
For example:
<p>${content.text}</p>
<%
String text = content.text;
text = text.substring( 4 );
%>
<p>Substring text: <%= text %></p>
Christian's response: In the magnolia project, there is the samples module:
http://svn.magnolia-cms.com/svn/community/magnolia/tags/magnolia-4.4.2/magnolia-module-samples
(here in 4.4.2 for example).
There are some JSP samples.
It's obvious that the ${content.text} works. But if I want to process that in
JSP code, I'm stuck. The code above doesn't work, as "content" is not a JSP
variable, so the line "String text = content.text" will fail. I know that a
simple thing as substring can probably be done in freemarker or with some util
function, but the code above is just a simplified example. The question is how
the "content" can be processed in JSP.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia-cms.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------