You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ramakrishnan Priya <Pr...@arbitron.com> on 2003/11/10 19:05:29 UTC

Struts across WARs

 
Hi...
 
I'm having difficulty using struts across WAR files within a single EAR. I
have a template defined in a.war and am trying to reference the template in
b.war - here's how I am doing it and it doesn't work. Assume a is the
context for a.war and b for b.war.
 
<template:insert template='/../a/site/workitems/lmDisplayTemplate.jsp'>
 
I get the following error -
 
<Nov 10, 2003 1:00:57 PM EST> <Alert> <HTTP> <Request uri for
"WebAppServletCont
ext(7234521,b,/b)" context did not start with context path "/b
">
<Nov 10, 2003 1:00:57 PM EST> <Error> <HTTP>
<[WebAppServletContext(7234521,b,
/b)] Root cause of ServletException
javax.servlet.jsp.JspException: Failed to resolve path:
/a/site/workitems/lmDis
playTemplate.jsp
 
Any ideas? Is this even possible?? Thanks!
Priya

Re: Struts across WARs

Posted by "Craig R. McClanahan" <cr...@apache.org>.
Quoting Brice Ruth <br...@fiskars.com>:

> I don't believe sharing Tiles across WARs is possible, since the Tiles 
> plug-in needs the Tiles 'context' which would be specific to the Tiles 
> plug-in that is processing a particular request, if I'm not mistaken ... 
> since each WAR runs its own Tiles plug-in, I don't believe any Tiles 
> related data can be shared ...
> 

It's not just Tiles resources you cannot share -- basically, you cannot share
*anything* across webapps unless you leverage container-specific facilities
(like the common/lib or shared/lib directory in Tomcat).  The fundamental issue
is that each webapp gets loaded by it's own class loader, which cannot see any
classes or resources from any other webapp.

A common strategy is to manage the shared resource files in a single source code
repository (so you only have to do changes once), and then arrange that the
application assemby portion of your build process pulls the required resources
into each WAR that needs them.

Craig


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: Struts across WARs

Posted by Brice Ruth <br...@fiskars.com>.
I don't believe sharing Tiles across WARs is possible, since the Tiles 
plug-in needs the Tiles 'context' which would be specific to the Tiles 
plug-in that is processing a particular request, if I'm not mistaken ... 
since each WAR runs its own Tiles plug-in, I don't believe any Tiles 
related data can be shared ...

Ramakrishnan Priya wrote:

> 
>Hi...
> 
>I'm having difficulty using struts across WAR files within a single EAR. I
>have a template defined in a.war and am trying to reference the template in
>b.war - here's how I am doing it and it doesn't work. Assume a is the
>context for a.war and b for b.war.
> 
><template:insert template='/../a/site/workitems/lmDisplayTemplate.jsp'>
> 
>I get the following error -
> 
><Nov 10, 2003 1:00:57 PM EST> <Alert> <HTTP> <Request uri for
>"WebAppServletCont
>ext(7234521,b,/b)" context did not start with context path "/b
>">
><Nov 10, 2003 1:00:57 PM EST> <Error> <HTTP>
><[WebAppServletContext(7234521,b,
>/b)] Root cause of ServletException
>javax.servlet.jsp.JspException: Failed to resolve path:
>/a/site/workitems/lmDis
>playTemplate.jsp
> 
>Any ideas? Is this even possible?? Thanks!
>Priya
>
>  
>

-- 
Brice D. Ruth
Sr. IT Analyst
Fiskars Brands, Inc.



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org