On 7 Jan 2003, Paul Vincent Craven wrote:
> Date: 07 Jan 2003 09:06:10 -0600 > From: Paul Vincent Craven <[EMAIL PROTECTED]> > Reply-To: Struts Developers List <[EMAIL PROTECTED]> > To: Struts Developers List <[EMAIL PROTECTED]> > Subject: Re: What happened to getDynaActionFormClass( )? > > On Mon, 2003-01-06 at 16:46, Craig R. McClanahan wrote: > > RequestUtils.createActionForm(), which does all the required work for > > either standard ActionForm or DynaActionForm type form beans. > > Thanks. This works well when I am inside an action. But I have one place > I want to do it from a JSP. I don't know how to fill in the parameters > from a JSP. To get the ActionMapping I need the ModuleConfig. But I > can't call my servlet instance to get the module config because that > member is protected. Probably to prevent me from trying to do exactly > what I am trying right now. All the ModuleConfig instances for all your modules are in servlet context attributes, so they are accessible from application scope. The attribute key is "org.apache.struts.action.MODULE" plus your module prefix (if you're using multiple modules). If you are processing a request that came in through the controller servlet (the recommended practice), the ModuleConfig for the current module will have been exposed as a request attribute under the same key ("org.apache.struts.action.MODULE") as well. > > My end goal is to fill a dynamic form field with a default if it is > specified as a URL parameter. I can do this if the parameters first go > to an action mapping. But I would prefer to not have the extra step and > just fill it in with some JSP code. > Sounds to me like you're trying to mix too much logic into your pages -- submitting to an Action that sets up the next beans for you is the better style. > Paul Vincent Craven > Craig -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>