[opencms-dev] v6a3 accessing vfs jsps from other contexts

Jack Bakker jbakker at iable.ca
Wed Mar 30 01:43:58 CEST 2005


In response to my own Feb 18 post, the solution to the below is, in a struts
app in a different context than opencms (see scenario below), to use the
JSESSIONIDSSO cookie in a http request by URL to opencms. Worked for me in
in a single sign on scenario with multiple existing struts apps needing to
fetch a header with breadcrumbs, a menu, and a footer from opencms - where
all contexts for the host share a SingleSignOn valve. 
 
Perhaps this is useful for others. 

Jack 

> -----Original Message-----
> From: opencms-dev-bounces at opencms.org 
> [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Jack Bakker
> Sent: Friday, February 18, 2005 11:09 AM
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] v6a3 accessing vfs jsps from other contexts
> 
> 
> apache -> mod_jk2 -> tomcat, postgresql
> v6a3
> 
> I have existing struts apps in separate contexts and want to 
> draw on jsp in opencms for menu and breadcrumbs
> 
> In the tomcat server.xml host block I have multiple contexts, 
> one of which points to opencms
> 
> ------
> 
> <Host name="www.domain.com" debug="0" appBase="" 
> unpackWARs="true"> <Context path="" crossContext="true" 
> docBase="webapps/main.domain.com" debug="0" reloadable="true" 
> /> <Context path="/app2"  crossContext="true" 
> docBase="webapps/app2.domain.com" debug="0" 
> reloadable="true"/> <Context path="/opencms" 
> crossContext="true" docBase="webapps/opencms" debug="0" 
> reloadable="true" />
> <Realm   className="org.apache.catalina.realm.JNDIRealm" 
> ...
> />
> <Valve className="org.apache.catalina.authenticator.SingleSignOn"
> debug="0"/>
> </Host>
> 
> -------
> 
> The default context (app main.domain.com) just redirects to 
> /opencms/opencms/en/ All access requires authentication 
> through the JNDIRealm. 
> 
> In a module's /elements, I have jsp for menu and breadcrumbs 
> 
> All is working fine, except now I want to access the jsp menu 
> and breadcrumbs from another context. 
> 
> 1)
> In app2 I tried using <c:import 
> url="http://www.domain.com/opencms/opencms/.../elements/menu.j
> sp"> I get a error 401. I can't pass in the jsessionid of the 
> app2 because this is a different jsessionid from opencms. 
> 
> 2)
> In app2 I tried <c:import context="/opencms" 
> url="/WEB-INF/jsp/online/system/modules/.../menu.jsp"> but 
> then the cms:link stuff didn't work.
> 
> Ideas on how I might be able to do this ? 
> 
> (As an aside, I will be passing in parameters to the menu.jsp 
> to set the current page and current folder to whatever)
> 
> 
> Thx.
> 
> Jack   
> 
> 
> 
> 
> _______________________________________________
> This mail is send to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, 
> please visit http://mail.opencms.org/mailman/listinfo/opencms-dev
> 
> 





More information about the opencms-dev mailing list