Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: Bean scope...

Ted Husted

2006-01-10

Replies:

After defining a form-bean for an ActionForm

<form-bean name="StatusSearchActionForm"

the next step is to relate the ActionForm to an ActionMapping. The
"name" attribute in an mapping refers to the "name" attribute in a
form-bean.

When a request is made for a *specific* action with the attribute
"name='StatusSearchActionForm'", the controller will create the
ActionForm and put into the context using "StatusSearchActionForm" as
the key.

The message

"Cannot find bean StatusSearchActionForm in any scope"

is probably being generated by a bean:write tag, or equivalent on a
page that was reached without going through an ActionMapping that
referred to the form-bean of that name. The controller only creates a
StatusSearchActionForm when it is told. If the bean doesn't exist,
it's because the controller has not been told to create one.

A point of confusion might be if the StatusSearchActionForm is created
in session scope. In that case, whether the bean exists when a given
action is called might depend on some other action being called first.
Using sessions scope for ActinoForms can lead to a situation when the
error seems inconsistent. Sadly, session scope is the default.

-- HTH, Ted.
http://www.husted.com/poe/


On 1/9/06, Shilpa.Nalgonda@(protected):
> Hi All,
> I keep getting this error , I have defined this bean in config file...
> Also...
> ---------Cannot find bean StatusSearchActionForm in any scope
>
>
>
> <form-beans>
>       <form-bean name="StatusSearchActionForm" type="com.ubs.eq.na.lynx.clientdata.StatusSearchActionForm" />
>   </form-beans>
>
> Do I have to define it somewhere else???
>
>
> -----Original Message-----
> From: garg.sandeep@(protected)]
> Sent: Monday, January 09, 2006 10:00 AM
> To: user@(protected)
> Subject: RE: user-unsubscribe@(protected)
>
>
> Hello
>
> I am new to struts.
>
> Can you please tell me where could I get the basic information regarding the same.
>
> Some of the basic books or pdf files for the basic understanding of struts
>
> -----Original Message-----
> From: garg.sandeep@(protected)]
>
> Sent: Monday, January 09, 2006 8:17 PM
> To: user@(protected)
> Subject: RE: user-unsubscribe@(protected)
>
>
> Hello
>
> I am new to struts.
>
> Can you please tell me where could I get the basic information regarding the same.
>
> Some of the basic books or pdf files for the basic understanding of struts
>
>
>
>
> -----Original Message-----
> From: »-(¯` Janarthan ´¯)-» [mailto:janarthanasp@(protected)]
>
> Sent: Monday, January 09, 2006 8:15 PM
> To: Struts Users Mailing List; struts-user@(protected)
> Subject: Re: user-unsubscribe@(protected)
>
> Could not understand the meaning of this mail :(
>
>
> struts-user <struts-user@(protected)
>
>
>
>
>
> Best Regards,
>  »-(¯` Janarthan ´¯)-»
>
> "The difference between Dreams and Achievements is purely Desire"

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.