Hi all, I got the answer for my problem.
Because I don't initialize properties which are objects :D
----- Original Message -----
From: "Pham Anh Tuan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Wednesday, June 01, 2005 4:31 PM
Subject: Re: Can't not reference to property of object which is property of
Bean
I got problem when I submit my form like what I described before.
"javax.servlet.ServletException: BeanUtils.populate
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1254)
at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:821)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:254)
"
"java.lang.IllegalArgumentException: No bean specified"
what's wrong ???
help me!
Anh Tuan
----- Original Message -----
From: "Pham Anh Tuan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>;
<[EMAIL PROTECTED]>
Sent: Wednesday, June 01, 2005 2:07 PM
Subject: Re: Can't not reference to property of object which is property
of Bean
Thank you, my problem is solved by your solution, Rokibul Islam Khan :)
----- Original Message -----
From: "Rokibul Islam Khan" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Wednesday, June 01, 2005 12:52 PM
Subject: Re: Can't not reference to property of object which is property
of Bean
hi,
U r getting that because of null property of privateMessage. As u r
using nested bean i.e. privateMessage.subject will be interpreted as
formBean.getPrivateMessage.getSubject() where as getPrivateMessage()
is returning null in ur case which cause Null pointer exception. To
avoid this u have two option. first u can make an object explicityly
from action and set it to formbean everytime before the call to the
page by setPrivateMessage() or initialize the privateMessage from the
constructor of ur form bean and overriden reset method. Remember u
have to override reset method and initialize privateMessage again if u
follow second option.
On 6/1/05, Pham Anh Tuan <[EMAIL PROTECTED]> wrote:
Hi all,
I have 1 problem:
I tried to do something like below:
test.jsp includes:
<html:form action="/user/sendPrivateQuestion.do" styleId="userBean">
<html:text property="privateMessage.subject" name="userBean"/>
</html:form>
I've already defined privateMessage in my userBean like below:
/**
* Comment for <code>privateMessage</code>
* This property is Private Message object
*/
private PrivateMessage privateMessage = null;
/**
* TODO: This will get value of privateMessage
*
* @return PrivateMessage the privateMessage.
*/
public PrivateMessage getPrivateMessage() {
return privateMessage;
}
/**
* TODO: This will set value to privateMessage
*
* @param PrivateMessage The privateMessage to set.
*/
public void setPrivateMessage(PrivateMessage privateMessage) {
this.privateMessage = privateMessage;
}
But when I action mapping to test.jsp page, I have errors with message
:
org.apache.jasper.JasperException: Null property value for
'privateMessage'
Plz, help me!
Thanks for ur reading
Anh Tuan
--
--
Rokibul Islam Khan
=================
Software Programmer
Spectrum Engineering Consortium Ltd.
Chandrashila Shuvastu Tower
Panth Path, Dhaka
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]