java.lang.NullPointerException at org.apache.commons.beanutils.PropertyUtils.getSimpleProperty(PropertyUtils.java:1162) at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:772) at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:801) at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:952) at org.apache.struts.taglib.html.BaseFieldTag.doStartTag(BaseFieldTag.java:176)
Can't I not define name attribute in action-mapping and use custom formBean?
[ August 31, 2004: Message edited by: Vladislav Semenov ] [ August 31, 2004: Message edited by: Vladislav Semenov ]
No its not the problem with the attribute name but if u are planning to use a form bean attached with an action that should be mentioned in struts-config u cant neglect that there and even writing it in <html:form of jsp wont work ............ these attributes in jsp are only if u want to name the form as per ur wish if u dont give struts will defaultly name the form(i am taklking about <form name='")as the one in strust-condifg ............
that null pointer is bcoz its not able to find the inctance of ur form bean
Joined: Mar 01, 2004
Originally posted by sreenath reddy: No its not the problem with the attribute name but if u are planning to use a form bean attached with an action that should be mentioned in struts-config
And if I want to use a form bean not attached with an action?
Can I use custom form with the custom action?
If I can't do it - I can't write complicated actions which can work with the set of forms.....
[ September 01, 2004: Message edited by: Vladislav Semenov ] [ September 01, 2004: Message edited by: Vladislav Semenov ]
This direction can be done many ways. Many people will call this action chaining and tell you that this is a bad idea, but in this case -- assuming that Action 1 does not do anything other than the redirect -- it should be perfectly fine.
BTW, DynaForms are handy for proofing out an app but they make complex [custom] validations very difficult as you have to treat them similar to a Map. I know a lot of people like them. It's simply my opinion that in a large app they are probably more work to maintain than the standard Java code base of a form bean.
"Write beautiful code; then profile that beautiful code and make little bits of it uglier but faster." --The JavaPerformanceTuning.com team, Newsletter 039.