struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Toom <>
Subject Re: Multiple tiles layouts for single application
Date Mon, 09 May 2005 14:33:08 GMT
Yes, but a tile definition is just a.. tile definition. All my 
definitions extends a base tile:

<definition name="" 
	<put name="content" value="OVERRIDE THIS" />
	<put name="title" value="Search here" />

<definition name="" 
	<put name="content" value="/search/pages/search.jsp" />

And my forwards are:

<forward name="success" path="" />
<forward name="failure" path="" />

So now, if a request has been made to http://mysite/?layout=layout1 or 
whatever it seems like a nice solution not have to change anything in my 
action configuration and instead have a filter/extension of a controller 
indicating which tile definitions to use, is this possible? or do I have 
to add a action-mapping/forward for each new site I want enable this 
search functionality?

As I sad before, the main problem as I see it is the input parameter in 
form validation, I guess I could solve it with some action in the input 
parameter instead, but all those solutions feel ugly and leaves me with 
much work if anything is about to change..

Any other ideas? :)


Allistair Crossley wrote:
> Your requests should be routing through a Struts Controller via an ActionMapping, and
therefore your Action can examine the request and return the appropriate view which will be
a forward to the tile definition of your choice.
> Cheers, Allistair.
>>-----Original Message-----
>>From: Andreas Toom []
>>Sent: 09 May 2005 15:05
>>Subject: Multiple tiles layouts for single application
>>Hello, is there a way to switch tiles layout in an applaction 
>>on let's say request url. I have a struts-based application with a 
>>single purpose and I want to share this functionality with other 
>>php-based sites that my company have.
>>So if a request comes in to the site I want different layouts, each 
>>matching the calling site, for example:
>>http://myhost/myapp/ <- Original layout
>>http://myhost/myapp/site1 <- Site1 layout
>>http://myhost/myapp/site2 <- Site2 layout
>>The reason I wan't this is because I don't want do duplicate 
>>any action 
>>mappings in my struts-config. The major problem is form validation, 
>>since the input is just a simple tile definitions the app has 
>>no way to 
>>determine which layout to use. So if I had tiles-defs.xml, 
>>tiles-defs-site1.xml tiles-defs-site2.xml and a way to tell 
>>struts when 
>>to use which definition I figure the problem would be solved...
>>Is there a way to solve this without extending the request processor/ 
>>tiles plugin?, if not can anyone point me in a good start direction?
>>Any ideas appreciated.
>>To unsubscribe, e-mail:
>>For additional commands, e-mail:
> -------------------------------------------------------
> QAS Ltd.
> Developers of QuickAddress Software
> <a href=""></a>
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> -------------------------------------------------------
> </FONT>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message