The standard approach is to create an Action for each of your JSP's and
visit that before displaying the page. In the Action, you can make the
database retreival and populate the ActionForm properties relating to
the HTML controls. For list boxes, there is a handy LabelValue class in
the Example Application which you can use.

Using a custom tag to do this in a view would violate MVC principles,
and would not be something you would find in the Struts distribution ;-)

Though, our friends at Jakarta Taglibs offer a dbTags set that could be
used for this sort of thing ...


Lokesh Sahni wrote:
> 
> Hi All
> 
> I have very recently stated using Struts Framwork and
> being a part of a development team lot of web sites i
> have always had to create combo boxes and list boxes
> with prefilled values from databases.
> 
> For eg In a Shopping mall there is a possiblity of
> providing a list of all delivery locations which r
> picked from the database as the shop may keep on
> adding locations.
> 
> >From the source code of stuts downloaded from the site
> i found that there is no provision for this. If
> already this has been implemented then please inform
> me or I would appreciate if there is any other way of
> doing the same.
> 
> Thanks
> Lokesh

Reply via email to