Debugging Struts related errors when previewing forms
When previewing a form, SaveObjectAction tries to fetch an instance of FormBeanConfig from the struts config. If it's a new form, it creates a request variable called "instaBean." This variable is used to help preview choose the logic for field rendering.
The following tip is no longer valid - you are now able to preview forms after adding fields; however, this information may be useful.
If you’ve added new fields to the app that are not display fields and you attempt to preview the form before restarting the app, you will get an error, because this field is not in the form bean. Form beans must be generated by clicking "Generate Dynasite Source" from the Admin page. This action generates (among other files) an XML file that is read by the application upon startup used by struts to render files. For example, if the field is an input field with id = 251, struts looks for the properties of field251 in the form bean.
<html:text size="20" property="field${field.id}"/> ${field.units}
If it does not exist. The app give the following error:
javax.servlet.ServletException: No getter method for property field351 of bean org.apache.struts.taglib.html.BEAN
If you’ve only added a display field, you can preview, because it’s not calling anything in the formbean when it renders. Also, when you sort items in a form or edit fields that already exist, there is no need to restart the app before previewing.
- Printer-friendly version
- Login to post comments
- PDF version