• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

Submitting nested properties.

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have my main bean defined like this

public class OuterBeanForm extends ValidatorActionForm {

private String caseKey;
private InnerBeanForm innerBean
public String getCaseKey() {
return caseKey;
}

public void setCaseKey(String caseKey) {
this.caseKey = caseKey;
}

public InnerBeanForm getInnerBean() {
return innerBean;
}

public void setInnerBean(InnerBeanForm innerBean) {
this.innerBean = innerBean;
}
}



My inner bean is like this

public class InnerBeanForm {

private String quantity;

public String getQuantity() {
return quantity;
}
public void setQuantity(String quantity) {
this.quantity = quantity;
}

}


My jsp has something like this
<html-el:text property="innerBean.quantity" name="OuterBeanForm" />

when the page is displayed it properly displays the value assigned to quantity property of InnerBeanForm

But when I submit the form , I keep getting below error

java.lang.IllegalArgumentException: No bean specified
at org.apache.commons.beanutils.PropertyUtils.getPropertyDescriptor(PropertyUtils.java:837)
at org.apache.commons.beanutils.BeanUtils.setProperty(BeanUtils.java:934)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:808)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:495)
at org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:798)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:205)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at us.ny.state.health.hin.cdess.security.CdessFilter.doFilter(CdessFilter.java:570)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at us.ny.state.health.hin.framework.security.HinFilter.doFilter(HinFilter.java:256)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6458)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)



Please advice me what I am missing.
[ December 20, 2006: Message edited by: Vani D Bandargal ]
 
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try with a lower case - "outerBeanForm" in the html-el tag.
 
Vani Bandargal
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried. no luck. while loading the page. even if I remove name attribute, it works.

Please help me
 
Zip Ped
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry, I couldnt quite get it. You say it works without giving a name attribute?
 
Vani Bandargal
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when the page get loaded both of the following options do work.
one with name attribute and another without name attribute.
<html-el:text property="innerBean.quantity" name="OuterBeanForm" />
<html-el:text property="innerBean.quantity" />

but when I submit the form , I get error. So I thought that name is not realy causing problem but(I could be wrong) I am unable figure out why I am getting error.
 
Vani Bandargal
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I solved my problem. I needed to add this in my OuterBeanForm

public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest)
{
innerBean=new InnerBeanForm();
innerBean.setQuantity("");
}
 
Lookout! Runaway whale! Hide behind this tiny ad:
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic