struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Miser" <midas...@hotmail.com>
Subject struts-template and MVC
Date Thu, 01 Jan 1970 00:00:00 GMT
I originally wrote a Struts app that acted much like the struts-example. I 
feel it's a good separation of business logic from presentation, and that it 
follows the principles of MVC pretty well.

Now the GUI developers are looking to integrate all of my very ugly HTML 
pages into a common look and feel. I thought that the struts-template 
mechanism would be perfect. I can define my header, sidebar, footer and 
dynamic content using this library.

However, I noticed that the struts-template mechanism seems to be based on 
JSP pages, as opposed to actions. For example, the InsertTag class' doEndTag 
method calls pageContext.include, so I can't simply specify:
  <template:put name='content' content='/displayRoles.do?type=external'/>

When I do that, I get an exception (which makes sense).

I'd like the best of both worlds by providing the templating capability and 
still keeping my action-based web site. I was thinking of extending the 
template:put tag to accept something like this:
  <template:put name='content' action='/displayRoles.do?type=external'/>

That way, the action class will execute and eventually forward itself on to 
the "success" page defined in struts-config.xml.

So, did I miss something here? Is my analysis of this situation right? Are 
people using struts-template in a capacity other than a layout/presentation 
manager? Would the Components framework by Cedric solve this? Finally, if I 
got it all right, is there any interest in seeing this type of extension?

Thanks for your time.
--
Dan Miser
http://www.distribucon.com

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


Mime
View raw message