struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gemes Tibor <...@i-trade.hu>
Subject Re: Bean in the view or in the model?
Date Wed, 18 Jun 2003 06:43:26 GMT
Andy Cheng írta:

>hi! I am currently learning struts, and I have a bean that I can set
>some parameters, and then it query the database, render and return the
>result as a HTML table.  I am just wondering if I should place this bean
>in the View (the jsp page), or the Model then return the string (HTML
>table) to the JSP page using request for displaying? Would there be a
>better way? 
>
You cannot link it to either since it is a mixture of View and 
Controller which is counter the suggested methodology of struts.
It should be refactored.  If you want to create a different app (swing 
based, or even create a soap service) it
would give no help to the app if it receives the results in HTML. They 
just need a collection.

On the other hand rendering a HTML table from a Collection is just a 
matter of a logic:iterate tag
and a few bean:write tags.

Hth,

Tib






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


Mime
View raw message