You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chandramouli P <ch...@live.com> on 2008/07/03 05:46:14 UTC

Problem from defining JavaBean as an attribute inside ActionForm

Hi,
 
I have the below scenario:
 
I have a java bean as below:
 
public class Address
{
     private String city;
     private String state;
 
     and public getters/setters for the above attributes;
}
 
and I have the ActionForm as below:
 
import Address;
public class EmpForm extends ActionForm
{
     private String name;
     private String empID;
     private Address empAddress;
 
     and public getters/setters for the aboev attribute;
}
 
We are using Struts 1.2.9 and writing the JSP page as below:
 
<html:form action="/sampleAction.do">
      <html:text property="name"/>
      <html:text property="empID"/>
      <html:text property="empAddress.city"/>
      <html:text property="empAddress.state"/>
</html:form>
 
I am getting the below error while submitting the form:
 
E SRVE0026E: [Servlet Error]-[BeanUtils.populate]: java.lang.IllegalArgumentException: No bean specified at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java(Compiled Code))
I have read somewhere that Struts version I am using does support the nested attributes for the <html:text> and other tags. Are there any errors in the above code? Please help.
 
Thanks & Regards,
Chandra.
_________________________________________________________________
Post free property ads on Yello Classifieds now! www.yello.in
http://ss1.richmedia.in/recurl.asp?pid=221

Re: Problem from defining JavaBean as an attribute inside ActionForm

Posted by Lukasz Lenart <lu...@googlemail.com>.
> From day one, as far as I know.

What? 4 years of blindness? What a mess, I have to go back to basis,
bheee..... :P


Kind regards
-- 
Lukasz
http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem from defining JavaBean as an attribute inside ActionForm

Posted by Laurie Harper <la...@holoweb.net>.
Lukasz Lenart wrote:
>> For the record, Struts 1 definitely supports dot-notation access to
>> sub-fields. That's not the problem here.
> 
> Upsss... ;-)
> Could you clarify my doubts, from which version?

 From day one, as far as I know.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem from defining JavaBean as an attribute inside ActionForm

Posted by Lukasz Lenart <lu...@googlemail.com>.
> For the record, Struts 1 definitely supports dot-notation access to
> sub-fields. That's not the problem here.

Upsss... ;-)
Could you clarify my doubts, from which version?


Regards
-- 
Lukasz
http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem from defining JavaBean as an attribute inside ActionForm

Posted by Laurie Harper <la...@holoweb.net>.
Lukasz Lenart wrote:
>> We are using Struts 1.2.9 and writing the JSP page as below:
>>
>> <html:form action="/sampleAction.do">
>>      <html:text property="name"/>
>>      <html:text property="empID"/>
>>      <html:text property="empAddress.city"/>
>>      <html:text property="empAddress.state"/>
>> </html:form>
> 
> As I remember, Struts 1 don't support such evaluation, you can use

For the record, Struts 1 definitely supports dot-notation access to 
sub-fields. That's not the problem here.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Problem from defining JavaBean as an attribute inside ActionForm

Posted by Chandramouli P <ch...@live.com>.
Hi,
 
Thanks for getting back to me.
 
All I was trying to do is getting the inside bean's values along with the ActionForm, so that I can handle those in my Action class.
Please suggest a best way to achieve that.
 
Thanks & Regards,
Chandra.



> Date: Thu, 3 Jul 2008 08:05:08 +0200> From: lukasz.lenart@googlemail.com> To: user@struts.apache.org> Subject: Re: Problem from defining JavaBean as an attribute inside ActionForm> > Hi> > > We are using Struts 1.2.9 and writing the JSP page as below:> >> > <html:form action="/sampleAction.do">> > <html:text property="name"/>> > <html:text property="empID"/>> > <html:text property="empAddress.city"/>> > <html:text property="empAddress.state"/>> > </html:form>> > As I remember, Struts 1 don't support such evaluation, you can use> Nested Tags [1] , example are here [2]> > [1] http://struts.apache.org/1.2.9/userGuide/struts-nested.html> [2] http://www.mail-archive.com/struts-user@jakarta.apache.org/msg47798.html> > > Regards> -- > Lukasz> http://www.lenart.org.pl/> > ---------------------------------------------------------------------> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org> For additional commands, e-mail: user-help@struts.apache.org> 
_________________________________________________________________
Post free property ads on Yello Classifieds now! www.yello.in
http://ss1.richmedia.in/recurl.asp?pid=219

Re: Problem from defining JavaBean as an attribute inside ActionForm

Posted by Lukasz Lenart <lu...@googlemail.com>.
Hi

> We are using Struts 1.2.9 and writing the JSP page as below:
>
> <html:form action="/sampleAction.do">
>      <html:text property="name"/>
>      <html:text property="empID"/>
>      <html:text property="empAddress.city"/>
>      <html:text property="empAddress.state"/>
> </html:form>

As I remember, Struts 1 don't support such evaluation, you can use
Nested Tags [1] , example are here [2]

[1] http://struts.apache.org/1.2.9/userGuide/struts-nested.html
[2] http://www.mail-archive.com/struts-user@jakarta.apache.org/msg47798.html


Regards
-- 
Lukasz
http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 'include' struts.xml stuff is broken?

Posted by Gabriel Belingueres <be...@gmail.com>.
In your struts-editevent.xml: http://pastebin.stonekeep.com/4956
<action> tags must be inside a <package>, and they are inside <struts>.

See the http://struts.apache.org/dtds/struts-2.0.dtd file

2008/7/16 Dave Belfer-Shevett <db...@homeport.org>:
> This seems like it should work, but I'm getting all sorts of hassles, and
> the documentation page for this, naturally, provides no examples of what the
> include file should look like.
>
> My struts.xml has...
>
> <!DOCTYPE struts PUBLIC
>    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>    "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
>        <include file="struts-editevent.xml">
>        <package name="CONGO" extends="struts-default">
>                <interceptors>
>                [blah blah blah]
>                </interceptors>
>        (more actions)
>        </package>
> </struts>
>
> The 'struts-editevent.xml' has:
>        <action name="coconut/viewEditEvent" method="load"
> class="com.stonekeep.congo.coconut.EditEvent">
>                <interceptor-ref name="mystack" />
>                <result
> name="success">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
>                <result name="login"
> type="redirect-action">coconut/showloginpage</result>
>        </action>
>
>        <action name="coconut/postEditEvent" method="update"
> class="com.stonekeep.congo.coconut.EditEvent">
>                <interceptor-ref name="mystack" />
>                <result
> name="success">/WEB-INF/jsp/coconut/Maintenance.jsp</result>
>                <result
> name="input">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
>                <result name="login"
> type="redirect-action">coconut/showloginpage</result>
>        </action>
>
> A basic block of actions.
>
> I'm getting XML validatoin errors up the wazoo because the
> struts-editevent.xml file isn't well-formed.  If I put it in <struts>
> blocks, I get "you're referencing interceptors that don't exist".
>
> If I try and duplicate the entire package, interceptors, and DTD definition
> into the include file, I get package collisions.
>
> My take is the <include> function does not work as described in the
> documentation.  It should be a linear include, and the resulting document is
> parsed by SAX, but that doesn't seem to be happening.
>
> Can someone give me an example of an included XML file that actually works?
>
> Here are links to what I'm seeing:
> My main struts.xml: http://pastebin.stonekeep.com/4955
>
> My struts-editevent.xml: http://pastebin.stonekeep.com/4956
>
> What happens when I deploy:
>
> http://pastebin.stonekeep.com/4957
>
> Note that says "no grammar found".  Adding the DTD says "you need a package
> name in your struts block" - etc etc etc.  It never really resolves.
>
> Can someone show me an <include> setup that actually works?
>
> --
> -------------------.--------.-------------------------------.
> Dave Belfer-Shevett \ KB1FWR \ JID: dbs@jabber.stonekeep.com \
> blog:planet-geek.com >--------'-----------------------------------.
> dbs@homeport.org    /   Windows98 Err#021 - Error Parsing Error    \
> -------------------<        List; Please Wait For Next Error        |
>                    \______________________________________________/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 'include' struts.xml stuff is broken?

Posted by Wes Wannemacher <we...@wantii.com>.
When you use an include, the entire included document is parsed and
added to the configuration. This means that the included document must
work as if it were a stand-alone configuration file. You'll have to not
only create well-formed struts xml files, but package configuration as
well. If you're going to reuse interceptors, etc., then you'll need to
pull them in with "extends".

-Wes

On Tue, 2008-07-15 at 23:53 -0400, Dave Belfer-Shevett wrote:
> This seems like it should work, but I'm getting all sorts of hassles, and 
> the documentation page for this, naturally, provides no examples of what 
> the include file should look like.
> 
> My struts.xml has...
> 
> <!DOCTYPE struts PUBLIC
>      "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
>      "http://struts.apache.org/dtds/struts-2.0.dtd">
> <struts>
>  	<include file="struts-editevent.xml">
>  	<package name="CONGO" extends="struts-default">
>  		<interceptors>
>  		[blah blah blah]
>  		</interceptors>
>  	(more actions)
>  	</package>
> </struts>
> 
> The 'struts-editevent.xml' has:
>  	<action name="coconut/viewEditEvent" method="load" 
> class="com.stonekeep.congo.coconut.EditEvent">
>  		<interceptor-ref name="mystack" />
>  		<result 
> name="success">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
>  		<result name="login" 
> type="redirect-action">coconut/showloginpage</result>
>  	</action>
> 
>  	<action name="coconut/postEditEvent" method="update" 
> class="com.stonekeep.congo.coconut.EditEvent">
>  		<interceptor-ref name="mystack" />
>  		<result 
> name="success">/WEB-INF/jsp/coconut/Maintenance.jsp</result>
>  		<result 
> name="input">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
>  		<result name="login" 
> type="redirect-action">coconut/showloginpage</result>
>  	</action>
> 
> A basic block of actions.
> 
> I'm getting XML validatoin errors up the wazoo because the 
> struts-editevent.xml file isn't well-formed.  If I put it in <struts> 
> blocks, I get "you're referencing interceptors that don't exist".
> 
> If I try and duplicate the entire package, interceptors, and DTD 
> definition into the include file, I get package collisions.
> 
> My take is the <include> function does not work as described in the 
> documentation.  It should be a linear include, and the resulting document 
> is parsed by SAX, but that doesn't seem to be happening.
> 
> Can someone give me an example of an included XML file that actually 
> works?
> 
> Here are links to what I'm seeing:
> My main struts.xml: http://pastebin.stonekeep.com/4955
> 
> My struts-editevent.xml: http://pastebin.stonekeep.com/4956
> 
> What happens when I deploy:
> 
> http://pastebin.stonekeep.com/4957
> 
> Note that says "no grammar found".  Adding the DTD says "you need a 
> package name in your struts block" - etc etc etc.  It never really 
> resolves.
> 
> Can someone show me an <include> setup that actually works?
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 'include' struts.xml stuff is broken?

Posted by Dave Newton <ne...@yahoo.com>.
--- On Wed, 7/16/08, Dave Belfer-Shevett <db...@homeport.org> wrote:
> And was completely unmentioned in the document I was looking at:

Sorry we didn't put it where you looked. In general I usually recommend looking at core documentation in addition to FAQs, it provides context for the more free-form, supplementary nature of FAQs.

I've changed the FAQ entry [1] to point to the core documentation. (Note that changes are not immediately visible.)

> That FAQ should have had a link along the lines of
> "Full documentation for include is [here...].

Feel free to file a CLA and contribute to the documentation or file JIRA issues against existing documentation; input and contributions are helpful and appreciated (even more so without sniping and implied obligation :)

> What neither document mentions is how to configure both the
> top level struts.xml and the secondary files to avoid duplicating
> entire interceptor stacks using packages.

You lost me there; once an element (interceptor, stack, whatever) is defined it's available to subsequent elements. The <package...> documentation [2] describes the use of the "extends" attribute and states:

"The extends attribute is optional and allows one package to inherit the configuration of one or more previous packages - including all interceptor, interceptor-stack, and action configurations."

Dave

[1] Breaking up config files FAQ entry:
http://struts.apache.org/2.x/docs/can-we-break-up-a-large-strutsxml-file-into-smaller-pieces.html

[2] <package...> documentation:
http://struts.apache.org/2.x/docs/package-configuration.html


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 'include' struts.xml stuff is broken?

Posted by Dave Belfer-Shevett <db...@homeport.org>.
On Wed, 16 Jul 2008, Dave Newton wrote:
> --- On Tue, 7/15/08, Dave Belfer-Shevett <db...@homeport.org> wrote:
>> [...] the documentation page for this, naturally, provides
>> no examples of what the include file should look like.
>
> "Naturally?"
>
> Sniping aside: the "include" documentation [1] states the following:
>
> "Each included file must be in the same format as struts.xml, including the DOCTYPE. The include files can be placed anywhere on the classpath and should be referred to by that path by the "file" attribute."
>
> To me that implies a well-formed, complete S2 config file.

And was completely unmentioned in the document I was looking at:
http://struts.apache.org/2.x/docs/can-we-break-up-a-large-strutsxml-file-into-smaller-pieces.html

That FAQ should have had a link along the lines of "Full documentation for 
include is [here...].

What neither document mentions is how to configure both the top level 
struts.xml and the secondary files to avoid duplicating entire interceptor 
stacks using packages.  1-2 lines referring to other bits of information 
would have been enormously helpful.

I did finally get it working, using an <include> in struts.xml, and in the 
included struts.xml, added dtd, a new package definition, and an 
'extends=' reference to the parent package.


-- 
-------------------.--------.-------------------------------.
Dave Belfer-Shevett \ KB1FWR \ JID: dbs@jabber.stonekeep.com \
blog:planet-geek.com >--------'-----------------------------------.
dbs@homeport.org    /   Windows98 Err#021 - Error Parsing Error    \
-------------------<        List; Please Wait For Next Error        |
                     \______________________________________________/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: 'include' struts.xml stuff is broken?

Posted by Dave Newton <ne...@yahoo.com>.
In addition to the other replies, I'll add my own.

--- On Tue, 7/15/08, Dave Belfer-Shevett <db...@homeport.org> wrote:
> [...] the documentation page for this, naturally, provides 
> no examples of what the include file should look like.

"Naturally?"

Sniping aside: the "include" documentation [1] states the following:

"Each included file must be in the same format as struts.xml, including the DOCTYPE. The include files can be placed anywhere on the classpath and should be referred to by that path by the "file" attribute."

To me that implies a well-formed, complete S2 config file.

> It should be a linear include, and the resulting document 
> is parsed by SAX, but that doesn't seem to be happening.

I don't know if "should" is an appropriate word here. It may not meet your expectations, but it works as described, and in some ways is better than a linear include.

Dave

[1] "include" documentation:
http://struts.apache.org/2.x/docs/include-configuration.html



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


'include' struts.xml stuff is broken?

Posted by Dave Belfer-Shevett <db...@homeport.org>.
This seems like it should work, but I'm getting all sorts of hassles, and 
the documentation page for this, naturally, provides no examples of what 
the include file should look like.

My struts.xml has...

<!DOCTYPE struts PUBLIC
     "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
     "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
 	<include file="struts-editevent.xml">
 	<package name="CONGO" extends="struts-default">
 		<interceptors>
 		[blah blah blah]
 		</interceptors>
 	(more actions)
 	</package>
</struts>

The 'struts-editevent.xml' has:
 	<action name="coconut/viewEditEvent" method="load" 
class="com.stonekeep.congo.coconut.EditEvent">
 		<interceptor-ref name="mystack" />
 		<result 
name="success">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
 		<result name="login" 
type="redirect-action">coconut/showloginpage</result>
 	</action>

 	<action name="coconut/postEditEvent" method="update" 
class="com.stonekeep.congo.coconut.EditEvent">
 		<interceptor-ref name="mystack" />
 		<result 
name="success">/WEB-INF/jsp/coconut/Maintenance.jsp</result>
 		<result 
name="input">/WEB-INF/jsp/coconut/EditEventForm.jsp</result>
 		<result name="login" 
type="redirect-action">coconut/showloginpage</result>
 	</action>

A basic block of actions.

I'm getting XML validatoin errors up the wazoo because the 
struts-editevent.xml file isn't well-formed.  If I put it in <struts> 
blocks, I get "you're referencing interceptors that don't exist".

If I try and duplicate the entire package, interceptors, and DTD 
definition into the include file, I get package collisions.

My take is the <include> function does not work as described in the 
documentation.  It should be a linear include, and the resulting document 
is parsed by SAX, but that doesn't seem to be happening.

Can someone give me an example of an included XML file that actually 
works?

Here are links to what I'm seeing:
My main struts.xml: http://pastebin.stonekeep.com/4955

My struts-editevent.xml: http://pastebin.stonekeep.com/4956

What happens when I deploy:

http://pastebin.stonekeep.com/4957

Note that says "no grammar found".  Adding the DTD says "you need a 
package name in your struts block" - etc etc etc.  It never really 
resolves.

Can someone show me an <include> setup that actually works?

-- 
-------------------.--------.-------------------------------.
Dave Belfer-Shevett \ KB1FWR \ JID: dbs@jabber.stonekeep.com \
blog:planet-geek.com >--------'-----------------------------------.
dbs@homeport.org    /   Windows98 Err#021 - Error Parsing Error    \
-------------------<        List; Please Wait For Next Error        |
                     \______________________________________________/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Problem from defining JavaBean as an attribute inside ActionForm

Posted by Chandramouli P <ch...@live.com>.
Its working now. Thank you very much for the replies.
 
The problem was that the naming convention (it was like sStreet, sCity and the getter/setters were getStreet, getCity etc.)of my attributes and I did not initialize the inside bean in the ActionForm.
 
Thanks & Regards,
Chandra.



> To: user@struts.apache.org> From: laurie@holoweb.net> Subject: Re: Problem from defining JavaBean as an attribute inside ActionForm> Date: Thu, 3 Jul 2008 14:56:09 -0400> > Oh, and another thought: are you initializing ActionForm's empAddress > field somewhere? It may cause problems if it is null when Struts tries > to set its properties. Struts 2 can automatically create instances of > beans in that situation, but Struts 1 doesn't.> > L.> > Laurie Harper wrote:> > What you have below all looks fine; it should work as you expected. What > > does your form bean definition look like? Is the form bean correctly > > referenced by the action mapping the form is submitted to? Post the > > relevant bits of configuration and the full stack trace; maybe that will > > allow someone to see the problem.> > > > L.> > > > Chandramouli P wrote:> >> Hi,> >> > >> I have the below scenario:> >> > >> I have a java bean as below:> >> > >> public class Address> >> {> >> private String city;> >> private String state;> >> > >> and public getters/setters for the above attributes;> >> }> >> > >> and I have the ActionForm as below:> >> > >> import Address;> >> public class EmpForm extends ActionForm> >> {> >> private String name;> >> private String empID;> >> private Address empAddress;> >> > >> and public getters/setters for the aboev attribute;> >> }> >> > >> We are using Struts 1.2.9 and writing the JSP page as below:> >> > >> <html:form action="/sampleAction.do">> >> <html:text property="name"/>> >> <html:text property="empID"/>> >> <html:text property="empAddress.city"/>> >> <html:text property="empAddress.state"/>> >> </html:form>> >> > >> I am getting the below error while submitting the form:> >> > >> E SRVE0026E: [Servlet Error]-[BeanUtils.populate]: > >> java.lang.IllegalArgumentException: No bean specified at > >> org.apache.commons.beanutils.PropertyUtils..getPropertyDescriptor(PropertyUtils.java(Compiled > >> Code))> >> I have read somewhere that Struts version I am using does support the > >> nested attributes for the <html:text> and other tags. Are there any > >> errors in the above code? Please help.> >> > >> Thanks & Regards,> >> Chandra.> >> _________________________________________________________________> >> Post free property ads on Yello Classifieds now! www.yello.in> >> http://ss1.richmedia.in/recurl.asp?pid=221> > > ---------------------------------------------------------------------> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org> For additional commands, e-mail: user-help@struts.apache.org> 
_________________________________________________________________
Missed your favourite programme? Stop surfing TV channels and start planning your weekend TV viewing with our comprehensive TV Listing
http://entertainment.in.msn.com/TV/TVListing.aspx

Re: Problem from defining JavaBean as an attribute inside ActionForm

Posted by Laurie Harper <la...@holoweb.net>.
Oh, and another thought: are you initializing ActionForm's empAddress 
field somewhere? It may cause problems if it is null when Struts tries 
to set its properties. Struts 2 can automatically create instances of 
beans in that situation, but Struts 1 doesn't.

L.

Laurie Harper wrote:
> What you have below all looks fine; it should work as you expected. What 
> does your form bean definition look like? Is the form bean correctly 
> referenced by the action mapping the form is submitted to? Post the 
> relevant bits of configuration and the full stack trace; maybe that will 
> allow someone to see the problem.
> 
> L.
> 
> Chandramouli P wrote:
>> Hi,
>>  
>> I have the below scenario:
>>  
>> I have a java bean as below:
>>  
>> public class Address
>> {
>>      private String city;
>>      private String state;
>>  
>>      and public getters/setters for the above attributes;
>> }
>>  
>> and I have the ActionForm as below:
>>  
>> import Address;
>> public class EmpForm extends ActionForm
>> {
>>      private String name;
>>      private String empID;
>>      private Address empAddress;
>>  
>>      and public getters/setters for the aboev attribute;
>> }
>>  
>> We are using Struts 1.2.9 and writing the JSP page as below:
>>  
>> <html:form action="/sampleAction.do">
>>       <html:text property="name"/>
>>       <html:text property="empID"/>
>>       <html:text property="empAddress.city"/>
>>       <html:text property="empAddress.state"/>
>> </html:form>
>>  
>> I am getting the below error while submitting the form:
>>  
>> E SRVE0026E: [Servlet Error]-[BeanUtils.populate]: 
>> java.lang.IllegalArgumentException: No bean specified at 
>> org.apache.commons.beanutils.PropertyUtils..getPropertyDescriptor(PropertyUtils.java(Compiled 
>> Code))
>> I have read somewhere that Struts version I am using does support the 
>> nested attributes for the <html:text> and other tags. Are there any 
>> errors in the above code? Please help.
>>  
>> Thanks & Regards,
>> Chandra.
>> _________________________________________________________________
>> Post free property ads on Yello Classifieds now! www.yello.in
>> http://ss1.richmedia.in/recurl.asp?pid=221


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem from defining JavaBean as an attribute inside ActionForm

Posted by Laurie Harper <la...@holoweb.net>.
What you have below all looks fine; it should work as you expected. What 
does your form bean definition look like? Is the form bean correctly 
referenced by the action mapping the form is submitted to? Post the 
relevant bits of configuration and the full stack trace; maybe that will 
allow someone to see the problem.

L.

Chandramouli P wrote:
> Hi,
>  
> I have the below scenario:
>  
> I have a java bean as below:
>  
> public class Address
> {
>      private String city;
>      private String state;
>  
>      and public getters/setters for the above attributes;
> }
>  
> and I have the ActionForm as below:
>  
> import Address;
> public class EmpForm extends ActionForm
> {
>      private String name;
>      private String empID;
>      private Address empAddress;
>  
>      and public getters/setters for the aboev attribute;
> }
>  
> We are using Struts 1.2.9 and writing the JSP page as below:
>  
> <html:form action="/sampleAction.do">
>       <html:text property="name"/>
>       <html:text property="empID"/>
>       <html:text property="empAddress.city"/>
>       <html:text property="empAddress.state"/>
> </html:form>
>  
> I am getting the below error while submitting the form:
>  
> E SRVE0026E: [Servlet Error]-[BeanUtils.populate]: java.lang.IllegalArgumentException: No bean specified at org.apache.commons.beanutils.PropertyUtils..getPropertyDescriptor(PropertyUtils.java(Compiled Code))
> I have read somewhere that Struts version I am using does support the nested attributes for the <html:text> and other tags. Are there any errors in the above code? Please help.
>  
> Thanks & Regards,
> Chandra.
> _________________________________________________________________
> Post free property ads on Yello Classifieds now! www.yello.in
> http://ss1.richmedia.in/recurl.asp?pid=221


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org