You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mi...@edgil.com on 2004/03/03 17:00:01 UTC
No bean specified exception when submitting a form
Hi folks,
I'm sorely confused. I'm getting a "java.lang.IllegalArgumentException: No
bean specified" exception when I submit a form. Searching the list
archives, it seems that this is usually caused by a problem in the
struts-config, either no 'name' parameter in the action, or that parameter
set incorrectly...
I've looked at that, and everything seems fine. Here's the appropriate
sections of the struts-config...
The action I'm submitting is RetryTrans.do.
<form-beans>
<form-bean name="EnterTransForm" type
="com.edgil.TransactionMgr.Forms.EnterTransForm" />
<form-bean name="RetryTransForm" type
="com.edgil.TransactionMgr.Forms.RetryTransForm" />
</form-beans>
<action-mappings>
<action path="/EnterTrans" type
="com.edgil.TransactionMgr.Actions.EnterTransAction" name="EnterTransForm"
scope="request">
<forward name="AuthResult" path="/jsp/AuthResult.jsp" redirect
="false" />
</action>
<action path="/RetryTrans" type
="com.edgil.TransactionMgr.Actions.RetryTransAction" name="RetryTransForm"
scope="request">
</action>
</action-mappings>
Now for the part that has me very confused.
In the action which forwards to the RetryTrans jsp, I create a
RetryTransForm object, populate it, and put it on the request. When I get
to the jsp, the jsp is correctly populated with the data from that bean.
So, I know I can create a RetryTransForm, and there was one on the request.
Even more confusing, is that since the EnterTransForm and RetryTransForm
are very similar (only a few attributes are different), I tried changing
the action to be
<action path="/RetryTrans" type
="com.edgil.TransactionMgr.Actions.RetryTransAction" name="EnterTransForm"
scope="request">
and changed a few lines of code to populate the request with a
EnterTransForm object, and I stopped getting the "No Bean Specified"
exception, I get to the execute method of my RetryTransAction class.
Can anyone see what I'm doing wrong?
Mike
----
Mike Boucher mboucher@edgil.com
Edgil Associates www.edgil.com
"Don't take life too seriously, you'll never get out of it alive!"
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: No bean specified exception when submitting a form
Posted by John Fitzpatrick <jo...@vitarara.net>.
Mike,
Take a look at the rendered HTML for the EnterTransForm and ensure that you
see:
<form name="EnterTransForm" action="/EnterTrans" method="post">
It may be as simple as supplying the wrong arguments to <html:form> in the
JSP.
John
On 20040303 11:00 AM, "MichaelBoucher@edgil.com" <Mi...@edgil.com>
wrote:
> Hi folks,
>
> I'm sorely confused. I'm getting a "java.lang.IllegalArgumentException: No
> bean specified" exception when I submit a form. Searching the list
> archives, it seems that this is usually caused by a problem in the
> struts-config, either no 'name' parameter in the action, or that parameter
> set incorrectly...
>
> I've looked at that, and everything seems fine. Here's the appropriate
> sections of the struts-config...
>
> The action I'm submitting is RetryTrans.do.
>
> <form-beans>
> <form-bean name="EnterTransForm" type
> ="com.edgil.TransactionMgr.Forms.EnterTransForm" />
> <form-bean name="RetryTransForm" type
> ="com.edgil.TransactionMgr.Forms.RetryTransForm" />
> </form-beans>
>
> <action-mappings>
> <action path="/EnterTrans" type
> ="com.edgil.TransactionMgr.Actions.EnterTransAction" name="EnterTransForm"
> scope="request">
> <forward name="AuthResult" path="/jsp/AuthResult.jsp" redirect
> ="false" />
> </action>
> <action path="/RetryTrans" type
> ="com.edgil.TransactionMgr.Actions.RetryTransAction" name="RetryTransForm"
> scope="request">
> </action>
> </action-mappings>
>
> Now for the part that has me very confused.
>
> In the action which forwards to the RetryTrans jsp, I create a
> RetryTransForm object, populate it, and put it on the request. When I get
> to the jsp, the jsp is correctly populated with the data from that bean.
> So, I know I can create a RetryTransForm, and there was one on the request.
>
> Even more confusing, is that since the EnterTransForm and RetryTransForm
> are very similar (only a few attributes are different), I tried changing
> the action to be
> <action path="/RetryTrans" type
> ="com.edgil.TransactionMgr.Actions.RetryTransAction" name="EnterTransForm"
> scope="request">
>
> and changed a few lines of code to populate the request with a
> EnterTransForm object, and I stopped getting the "No Bean Specified"
> exception, I get to the execute method of my RetryTransAction class.
>
> Can anyone see what I'm doing wrong?
>
> Mike
> ----
> Mike Boucher mboucher@edgil.com
> Edgil Associates www.edgil.com
>
> "Don't take life too seriously, you'll never get out of it alive!"
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org