[opencms-dev] Re: JSP Support in 4.6.0

Alexander Kandzior alex at opencms.com
Tue Mar 26 10:16:22 CET 2002


Hi Patrick,

> The implication that I'm picking up from your description is that 
> we would create the JSP from the Explorer view, so that the JSP itself

> is fairly static, but at least it's managed via openCMS.

Exactly.

> I'm assuming then, that the idea would be to create a tag library that

> would allow JSP developers  to access the openCMS templating mechanism

> and dynamic content?

That sounds like a good idea. It will require some thinking on this
part, but should definitly be doable. 

> I'm not exactly sure about the URL rewriting that you were talking
about.

That is of importance only for the static export. Which is a new feature
in 4.6. If you don't export pages, don't bother. The point is that links
to exported pages must be changed. 

Heres an example: Ok, let's image for a secound that we already have JSP
support in opencms. Now lets say we have 2 pages in our tree:
/somepage.html [Type Page]
/my.jsp [Type JSP]

If you call these from outside, the URLs will be:
http://servername.com/opencms/opencms/somepage.html
http://servername.com/opencms/opencms/my.jsp

Now lets say you have a link from "my.jsp" to "somepage.html". You
basically could just say <a href="somepage.html">Go to somepage</a> in
your JSP, right? Now lets say Apache is installed and you do a static
export, where "somepage.html" gets exported and "my.jsp" doesn't. Then
the URLs would look like this:
http://servername.com/somepage.html
http://servername.com/opencms/opencms/my.jsp

Now your link from "my.jsp" is not longer working the way it should,
since basically the link URL has to be rewritten to "/somepage.html"
(note the leading slash). 

I assume that this could be handled in a taglib as well, basically
inserting some tags like <link>...</link> around the URL. Of course,
handling of this <link> tag has then to be adopted to work with JSP. 

In case you don't know, that <link> tag is introduced in the template
mechanism of OpenCms 4.6 already. So the rewriting stuff is already
there. It just needs to get adopted in the JSP. 

However, that static export stuff I personally see as Milestone 2.
Milestone 1 would be to have JSP running but without support for the
static export.

> I'll have to think about the caching some more.  
> If we implement the dynamic part of this in tags, then the tags can
load and 
> access dynamic content from the cache.  The entire page wouldn't be
there, but the 
> majority of what we need would be.

Sounds good. I am also thinking about adding OpenCms Cachedirectives as
propertys to the JSP file. 

Regards,
Alex.





More information about the opencms-dev mailing list