You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Paul Vincent Craven <pa...@WellsFargo.COM> on 2003/01/06 23:37:43 UTC

What happened to getDynaActionFormClass( )?

I notice DynaActionFormClass.getDynaActionFormClass( ) is gone in the
last beta. I was using it to pre-fill dynamic form classes. What am I
supposed to be using? setDynaActionFormClass is still there.

Paul Vincent Craven

Re: What happened to getDynaActionFormClass( )?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On 7 Jan 2003, Paul Vincent Craven wrote:

> Date: 07 Jan 2003 09:06:10 -0600
> From: Paul Vincent Craven <pa...@WellsFargo.COM>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: Struts Developers List <st...@jakarta.apache.org>
> 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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: What happened to getDynaActionFormClass( )?

Posted by Paul Vincent Craven <pa...@WellsFargo.COM>.
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.

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.

Paul Vincent Craven



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: What happened to getDynaActionFormClass( )?

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On 6 Jan 2003, Paul Vincent Craven wrote:

> Date: 06 Jan 2003 16:37:43 -0600
> From: Paul Vincent Craven <pa...@WellsFargo.COM>
> Reply-To: Struts Developers List <st...@jakarta.apache.org>
> To: struts-dev@jakarta.apache.org
> Subject: What happened to getDynaActionFormClass( )?
>
> I notice DynaActionFormClass.getDynaActionFormClass( ) is gone in the
> last beta. I was using it to pre-fill dynamic form classes. What am I
> supposed to be using? setDynaActionFormClass is still there.
>

RequestUtils.createActionForm(), which does all the required work for
either standard ActionForm or DynaActionForm type form beans.

> Paul Vincent Craven
>

Craig



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>