Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Submitting nested properties.

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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("");
}
 
We can walk to school together. And we can both read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!