Thanks David, The multiconfig eliminates the error message.
Another question is, the <html:link> is screwed up.
In traditional webpages, we've got, Header, Navbar, Body, maybe Footer.
The <html:link>s on the Navbar adds the context in their href locations.
EG, original link in root context: <a href="/jsppages/viewList.jsp">
now, the link after module switching: <a
href="/newModule/jsppages/viewList.jsp">

What can I do about this?

Thanks a lot really.
Patrick.

-----Original Message-----
From: Hibbs, David [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 17, 2003 11:16 PM
To: Patrick Cheng; Struts Users Mailing List
Subject: RE: Modules with Tiles Problem


If you have components used everywhere for every module, create some new
and separate struts-config.xml and tiles-defs.xml files.  You can
specify multiples of each type of file for each module, so each module
is free to reference a shared config file.  

To reference more than one struts-config.xml, simply list them in the
web.xml file separated by commas:

<init-param>
        <param-name>config/myModule</param-name>
        
<param-value>/WEB-INF/shared_config.xml,/WEB-INF/myModule_config.xml</pa
ram-
value>
</init-param>

To reference more than one tile definition file, you can do the same
thing in the myModule-config.xml file when you initialize the tiles
plugin...

<set-property 
        property="definitions-config" 
        value="/WEB-INF/tiles-defs/shared_defs.xml,
                /WEB-INF/tiles-defs/myModule_defs.xml" 
/>

Note, however, that you do NOT want to initiaize the tiles plugin in the
shared config file, or it will not reinitialize it from your module file
with your module definitions!

--David

David Hibbs, ACS
Staff Programmer / Analyst
Distributed Applications Development and Support
American National Insurance Company

> -----Original Message-----
> From: Patrick Cheng [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, December 17, 2003 1:27 AM
> To: Struts Users Mailing List
> Subject: RE: Modules with Tiles Problem
> 
> 
> HI All,
> I found a way to get it working.
> 
> <%org.apache.struts.util.RequestUtils.selectModule("",request,
> applicatio
> n);%>
> <html:form action="/Layout.do">
> 
> I have to do this for every html:form item.
> This works, but it is ugly. It's even worse since this method is
> deprecated in struts1.2.
> I'm suspecting there must be a better way round right?
> Can someone tell me if this is the way? Or there're smarter ways?
> 
> Rgds,
> Patrick.
> -----Original Message-----
> From: Patrick Cheng
> Sent: Wednesday, December 17, 2003 10:12 AM
> To: Struts Users Mailing List
> Subject: Modules with Tiles Problem
> 
> 
> Hi All,
> 
> I have a question on Tiles when using Modules(multiple 
> struts-config.xml's). As far as I know, switching between modules 
> requires more than providing different URLs. Either we use 
> ContextRelative forwards or using the struts Swiching Action class. 
> But in the situation of tiles, if the layout includes two jsp
> pages and they
> are from different modules, say, the top part is a generic search
> function, used everywhere for every module, what can I do about this?
> 
> Here's my situation.
> 2 struts configs : struts-config.xml, struts-module1-config.xml 
> Struts-config.xml has an action called 'layout'. Struts-module1-config

> has an action called 'ViewMultiSelect'. So when I go: 
> http://localhost:7001/RootContext/module1/ViewMultiSelect.do
> I got my ViewMultiSelect working, but in the tile 'layout', I got:
> 
> [ServletException in:/layout/Header.jsp] Cannot retrieve mapping for 
> action /Layout'
> 
> My understanding is, when the current module is in Module1,
> struts won't
> care anything in struts-config.xml, therefore it doesn't know about a
> Layout action. How can I get it to work?
> 
> Thanks a lot.
> 
> Rgds.
> Patrick.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to