aspose file tools*
The moose likes Struts and the fly likes Struts Status 500 error error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts Status 500 error error" Watch "Struts Status 500 error error" New topic
Author

Struts Status 500 error error

AnilPrakash Raju
Ranch Hand

Joined: Jul 26, 2004
Posts: 137
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

Joined: Jul 26, 2004
Posts: 137
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
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

You might get some replies if you post your tags and the form's accessor methods.


A good workman is known by his tools.
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
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

Joined: Jul 26, 2004
Posts: 137
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
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Try changing String to String[] in your accessor methods that deal with the 3 indexed properties.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts Status 500 error error