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

Robert Petermeier robert2.0 at gmx.de
Fri Mar 17 15:00:19 CET 2006


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.


Bye,
Robert



More information about the opencms-dev mailing list