You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Cedric Dumoulin <ce...@apache.org> on 2003/04/22 23:43:38 UTC

Re: Customize view based on content --> Tiles?

  Hi,

  Maybe you can use a Struts action that prepare the data, select the 
appropriate view and forward to it. The view can be a Tiles.

   Cedric

Menke, John wrote:

>We are designing an application where it's possible that the data coming
>from one action could possibly be formatted in several ways depending upon
>values in the database.  The current design uses the JSTL taglibs to
>customize display via <choose> and <if> tags along with custom taglibs
>designed by the company.
>
>I have found this to be a nightmare to debug.  Plus as the number of
>different possibilites for the data display increases this problem is only
>going to get worse.
>
>Has anyone designed an app that has different "views" like this?  How did
>you handle it?  I have used Tiles in a previous project and I'm thinking
>that I might be able to do some view customization via Tiles.  
>
>I appreciate any comments.
>
>-john
>
>  
>


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


RE: Customize view based on content --> Tiles?

Posted by Mike Jasnowski <mj...@bea.com>.
What I meant was, you can specify it on an individual tile, as well as the
definition I believe.

-----Original Message-----
From: Mike Jasnowski [mailto:mjasnows@bea.com]
Sent: Wednesday, April 23, 2003 10:30 AM
To: Struts Users Mailing List
Subject: RE: Customize view based on content --> Tiles?


You can also associate a controller with a tile definition.

-----Original Message-----
From: Dennis Muhlestein [mailto:dennis@zserve.com]
Sent: Wednesday, April 23, 2003 10:27 AM
To: struts-user@jakarta.apache.org
Subject: Re: Customize view based on content --> Tiles?


What you need to do is implement org.apache.struts.tiles.Controller for
each separate tile.  You associate a controller with a tile in your
tiles-defs.xml.  The controller gets called before the tile is rendered.

Put the view/business logic for the tile in each tile's controller.

Keep the logic in the action that forwards to separate views in the
action.  When the action forwards to view1, the controller for view1
will be called.  view1 doesn't have to know anything about view2,
Likewise, if you forward to view2, the business logic for view1 never
gets called.

We have many, many tiles and when we discovered controllers we jumped
for joy.

Hope this helps,
-Dennis

Cedric Dumoulin wrote:
>  Hi,
>
>  Maybe you can use a Struts action that prepare the data, select the
> appropriate view and forward to it. The view can be a Tiles.
>
>   Cedric
>
> Menke, John wrote:
>
>> We are designing an application where it's possible that the data coming
>> from one action could possibly be formatted in several ways depending
>> upon
>> values in the database.  The current design uses the JSTL taglibs to
>> customize display via <choose> and <if> tags along with custom taglibs
>> designed by the company.
>>
>> I have found this to be a nightmare to debug.  Plus as the number of
>> different possibilites for the data display increases this problem is
>> only
>> going to get worse.
>>
>> Has anyone designed an app that has different "views" like this?  How did
>> you handle it?  I have used Tiles in a previous project and I'm thinking
>> that I might be able to do some view customization via Tiles.
>> I appreciate any comments.
>>
>> -john
>>
>>
>>
>
> </div>
>
>


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



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




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


RE: Customize view based on content --> Tiles?

Posted by Mike Jasnowski <mj...@bea.com>.
You can also associate a controller with a tile definition.

-----Original Message-----
From: Dennis Muhlestein [mailto:dennis@zserve.com]
Sent: Wednesday, April 23, 2003 10:27 AM
To: struts-user@jakarta.apache.org
Subject: Re: Customize view based on content --> Tiles?


What you need to do is implement org.apache.struts.tiles.Controller for
each separate tile.  You associate a controller with a tile in your
tiles-defs.xml.  The controller gets called before the tile is rendered.

Put the view/business logic for the tile in each tile's controller.

Keep the logic in the action that forwards to separate views in the
action.  When the action forwards to view1, the controller for view1
will be called.  view1 doesn't have to know anything about view2,
Likewise, if you forward to view2, the business logic for view1 never
gets called.

We have many, many tiles and when we discovered controllers we jumped
for joy.

Hope this helps,
-Dennis

Cedric Dumoulin wrote:
>  Hi,
>
>  Maybe you can use a Struts action that prepare the data, select the
> appropriate view and forward to it. The view can be a Tiles.
>
>   Cedric
>
> Menke, John wrote:
>
>> We are designing an application where it's possible that the data coming
>> from one action could possibly be formatted in several ways depending
>> upon
>> values in the database.  The current design uses the JSTL taglibs to
>> customize display via <choose> and <if> tags along with custom taglibs
>> designed by the company.
>>
>> I have found this to be a nightmare to debug.  Plus as the number of
>> different possibilites for the data display increases this problem is
>> only
>> going to get worse.
>>
>> Has anyone designed an app that has different "views" like this?  How did
>> you handle it?  I have used Tiles in a previous project and I'm thinking
>> that I might be able to do some view customization via Tiles.
>> I appreciate any comments.
>>
>> -john
>>
>>
>>
>
> </div>
>
>


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



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


Re: Customize view based on content --> Tiles?

Posted by Dennis Muhlestein <de...@zserve.com>.
What you need to do is implement org.apache.struts.tiles.Controller for
each separate tile.  You associate a controller with a tile in your 
tiles-defs.xml.  The controller gets called before the tile is rendered.

Put the view/business logic for the tile in each tile's controller.

Keep the logic in the action that forwards to separate views in the 
action.  When the action forwards to view1, the controller for view1 
will be called.  view1 doesn't have to know anything about view2, 
Likewise, if you forward to view2, the business logic for view1 never 
gets called.

We have many, many tiles and when we discovered controllers we jumped 
for joy.

Hope this helps,
-Dennis

Cedric Dumoulin wrote:
>  Hi,
> 
>  Maybe you can use a Struts action that prepare the data, select the 
> appropriate view and forward to it. The view can be a Tiles.
> 
>   Cedric
> 
> Menke, John wrote:
> 
>> We are designing an application where it's possible that the data coming
>> from one action could possibly be formatted in several ways depending 
>> upon
>> values in the database.  The current design uses the JSTL taglibs to
>> customize display via <choose> and <if> tags along with custom taglibs
>> designed by the company.
>>
>> I have found this to be a nightmare to debug.  Plus as the number of
>> different possibilites for the data display increases this problem is 
>> only
>> going to get worse.
>>
>> Has anyone designed an app that has different "views" like this?  How did
>> you handle it?  I have used Tiles in a previous project and I'm thinking
>> that I might be able to do some view customization via Tiles. 
>> I appreciate any comments.
>>
>> -john
>>
>>  
>>
> 
> </div>
> 
> 


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