[opencms-dev] getting the locale of a page within <% %>

Christoph P. Kukulies kuku at physik.rwth-aachen.de
Fri Mar 17 15:37:40 CET 2006


On Fri, Mar 17, 2006 at 03:00:19PM +0100, Robert Petermeier wrote:
> Christoph P. Kukulies schrieb:
> >On Fri, Mar 17, 2006 at 01:10:28PM +0100, Robert Petermeier wrote:
> >>is probably what you are looking for. 'cmso' is an instance of 
> >>CmsObject, as you might have guessed;-)
> >
> >Which I have to initialize beforehand, how? Well, I will try to squeeze it
> >out of the docs. I think I must connect it to the context, request, 
> >response.
> >Should I create a JspBean and use getCmsObject() or how
> >do I initialize cmso?
> 
> It's a bit hard to believe that you have never used class CmsObject 
> before;-) However, it's done like this:
> 
> /---------------------------------------------
> | <jsp:useBean class="org.opencms.jsp.CmsJspActionElement" id="cjae" />
> |
> | <%
> |     cjae.init(pageContext, request, response);
> |     CmsObject cmso = cjae.getCmsObject();
> | %>
> \---------------------------------------------
> 
> Alternatively, you can create the action element in the same scriptlet.

I'm a beginner :-)

Good to have an alternative like the above. I was using 
an in line creation and I then stumbled across the problem that 
the CmsActionElement was already defined (in my head.jsp) while
it was defined again in foot.jsp.

Can you explain in a few words what the advantage of 
the <jsp:Bean construct is?

--
Chris Christoph P. U. Kukulies kukulies (at) rwth-aachen.de



More information about the opencms-dev mailing list