• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts Status 500 error error

 
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I encounter the status 500 error when i tried to save a form.

My form uses nested:iterate to display several rows of textfields.

** textfield ** textfield **
** textfield ** textfield **
** textfield ** textfield **
** textfield ** textfield **
save button

the user can edit several textfields in each row and by the hitting the save button, the whole vector should save.

But when i hit the save button,
i get the error

HTTP Status 500 - Internal Server Error
type Exception report

message Internal Server Error

description The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.

exception

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)
etc...


root cause

java.lang.NullPointerException
at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:515)
at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:428)
etc..

i put some break points in my action and action form, but it does seem to reach either tha actionForm or the action.

Thanks in advance

Anil
 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Actually my last comment should be

"i put some break points in my action and action form, but it does not seem to reach either tha actionForm or the action. "

thanks

Anil
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might get some replies if you post your tags and the form's accessor methods.
 
Ranch Hand
Posts: 415
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi anil

There might be some problem with the either data type of ur elements in the form bean r some mismatch while using Mapbacked actionforms

so if u can post ur jsp with the form bean then it would be helpful
 
AnilPrakash Raju
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks

the code in the jsp

<nested:iterate name="systemForm" property="reportPeriodVec" id="reportPeriod" type="vo.ReportPeriod" >
<tr class="trClass">
<td class="tdClass"><nested:text property="strPeriodStart" /> </td>
<td class="tdClass" ><nested:text property="strPeriodEnd" /> </td>
<td class="tdClass" ><nested:text property="strWorkingDays"/> </td>
</tr>
</nested:iterate>

the SystemForm have:

public String getStrPeriodStart(){ return strPeriodStart; }
public void setStrPeriodStart(String strPeriodStart)
{ this.strPeriodStart = strPeriodStart; }
public String getStrPeriodEnd() { return strPeriodEnd; }
public void setStrPeriodEnd(String strPeriodEnd)
{ this.strPeriodEnd = strPeriodEnd; }
public String getStrWorkingDays() { return strWorkingDays; }
public void setStrWorkingDays(String strWorkingDays)
{ this.strWorkingDays = strWorkingDays; }

public ReportPeriodVec getReportPeriodVec()
{ return reportPeriodVec; }
public void setReportPeriodVec(ReportPeriodVec reportPeriodVec)
{ this.reportPeriodVec = reportPeriodVec; }

Thanks

Anil
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try changing String to String[] in your accessor methods that deal with the 3 indexed properties.
 
reply
    Bookmark Topic Watch Topic
  • New Topic