dcsimg
Subclassing the TileRequestProcessor to read Definitions from Db
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Aad_Nales
Posted On:   Wednesday, January 22, 2003 12:39 AM

The project that I am involved in is creating an Open Source community management system based on Struts. Part of the system is a content management system. In this content management system we define destinations (roughly equivalent to definitions) to consist of multiple areas (roughly equivalent to tiles). The problem we were faced with is that a definition once read from an XML file seems to lack a dynamic interface to overload the attributes. We solved it but we are looking for feedback on our strategy. Here is what we did We needed the ability to take any well-behaved Struts application and sandwich it into a one of our destination pages. Imagine, if you will, a forum system with a postMessage.jsp with a submit button    More>>

The project that I am involved in is creating an Open Source community management system based on Struts. Part of the system is a content management system. In this content management system we define destinations (roughly equivalent to definitions) to consist of multiple areas (roughly equivalent to tiles).



The problem we were faced with is that a definition once read from an XML file seems to lack a dynamic interface to overload the attributes. We solved it but we are looking for feedback on our strategy. Here is what we did



We needed the ability to take any well-behaved Struts application and sandwich it into a one of our destination pages. Imagine, if you will, a forum system with a postMessage.jsp with a submit button


What we need our system to do is take that jsp. show it with a system wide defined header,footer and with a number of other tiles filled under our control left en right from it

The problem with this approach is offcourse that the submit will cause an action to be fired and a forward to take place that is no longer under control of our content management system


What we did is: We created a wrappers.xml which references for each action in what destination format it should be shown, and in what tile. In the our subclass of the TileRequestProcessor we catch the processAction and process the submit action. After that we take the path from the ActionForward and store this path in the ComponentContext and forward the request our destination.do action. In destination.do we fill in all the tiles with the information from the database, skipping the ones that have already been filled in by our RequestProcessor.

We then forward control to the definition that is linked to the destination.



Very much to our suprise (and satisfaction) this solution seems to work. But we are left with a few questions, that we hope that some Tiles guru our there can answer for us.





  • In the TileRequestProcessor an include is treated different from a forward. The distinction is made on the basis that a CompenentContext is found in the Request. What purpose does this distinction serve?



  • We hit on the ComponentContext figured out it's purpose and used it, but we can not believe this to be a part of tiles API. Is there another way to get definitions/tiles from a database?



  • Although i believe this to be the official Tiles forum I have not seen a lot of questions posted. Should i crosspost questions like these to any other forum?




Cheers,

Aad    <<Less

Re: Subclassing the TileRequestProcessor to read Definitions from Db

Posted By:   Ted_Husted  
Posted On:   Sunday, January 26, 2003 04:34 PM

The official Tiles forum would be

the Struts USER list
.


The creator of Tiles,

Cedric Dumoulin
, frequents the list there. I'm sure he'd be quite interested in your application.


HTH, Ted.


--


Struts in Action

About | Sitemap | Contact