[opencms-dev] Need JSP specific info on OpenCMS

Kai Widmann Widmann at mediaworx.de
Tue Oct 22 10:11:45 CEST 2019


Hi Nili C,

let me go between the lines.

Am 21.10.2019 um 20:36 schrieb Nili C <nilimesh at hotmail.com<mailto:nilimesh at hotmail.com>>:

Hi,

We are at a very initial stage and pondering if we could use OpenCMS for our content needs, and I need some help answer few questions on OpenCMS.  Will appreciate any help to make this decision.

  1.  Currently, we render JSP's for all our content needs (not HTML).  All the demo/examples I find mostly talk about HTML content.  Can we use OpenCMS to create JSP's instead of HTML pages?

OpenCms templates/formatters are JSPs, but mostly they render HTML pages. So JSPs are used for HTML templating, but you can do whatever you want in JSPs, you can use Tag Libraries, use the OpenCms Tag Library, create custom tags and so on. In OpenCms the term „template“ is used for page templates, „formatters“ are also templates, but for smaller content elements contained in pages (like teasers).


  1.  Can we edit the JSP's online (wysiwig) - or do we need to open the file separately, save and then reload the page each time?

Yes, WYSIWYG editing of pages is part of the OpenCms concept.


  1.  When we export the JSP, can it contain includes (such as <%@ include file="../myframework/includes/Header.jsp" %>.

Yes, includes are possible, but it’s not how things in OpenCms are usually done. If you have a common header on all pages, it’s added as a (unique) content element, not via JSP include.

  1.  Can we use simple JSP scriptlet within the JSP to be created?  (to customize content for specific user groups set in the session object)

Yes, although I prefer to use custom tags, but scriptlets are possible.


  1.  Is there any good demo / documentation that shows how to do the above?

I know that there is a demo, I’ve used it ages ago. You can find more info here: http://www.opencms.org/en/demo/


  1.  Are there any OOTB templates/modules that can be used to achieve the above?

Yes, there is the so called „Mercury“ demo template with source code on GitHub, you can find more general info here: http://www.opencms.org/en/news/190904-opencms-v1101.html

  1.  Any advise, watch out, dont do this, etc. for creating JSP's will be greatly appreciated.

As I said, using JSP includes is not the OpenCms way, so I’d advise against it. If you need include like features, there’s something similar coming from OpenCms (don’t remember the name, I think "CMS-Includes"). Other then that we use a lot of custom tags (via a Java backed TLD and via simple Tag files) to keep scriptlets out of the JSP templates and to avoid duplicate code. OpenCms is really open, so it’s quite easy to extend existing CMS tags for your own needs.

  1.  Finally, is there any developers forum, that one can join, discuss and that has better search?  or this mail list is only the way for developers to get any answers?

I don’t know of any other than this mailinglist. But this is still quite active.

Thanks & Appreciate your help.

Best

Kai

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20191022/854ffecf/attachment.htm>


More information about the opencms-dev mailing list