> -----Original Message----- > From: Rademacher Tobias [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 28, 2002 10:15 PM > To: '[EMAIL PROTECTED]' > Subject: [Newbie] Where to put Model Access whenever Action > class is not > an option? > > Hi Folks, > > first of all I'm a newbie to Struts. As far as I can see it's a great > framework. Thx for that a lot. > > My Problem is that my JSP-Views needs some inital data from > the models. > Consider some <select>-boxes given the > user a chance make their choices.... > > Where can I init the FromBeans that are use to share data > between Action > class/View? The constructor of > the class? As far as I understand the Struts delegates form > View to Action > using the FormBean and ActionMappings. > So Action is always the end of the request chain (view
The answer is pretty simple. You make sure an Action is set up to populate a view. The one page you can't directly do this for is the initial page of the application. To alleviate this, your initial page always looks something like this: ----index.jsp--------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %> <logic:forward name="main"/> ----index.jsp--------- -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>