Hi everybody,
I have this action
<!-- Editar institucion -->
<action path="/editarInstitucion"
type="co.com.proveedores.EditarInstitucionAction"
attribute="institucionForm"
scope="request"
validate="false">
<forward name="success" path="/editarInstitucion.jsp"/>
</action>
and this form-bean...
<!-- Institucion form bean -->
<form-bean name="institucionForm"
type="org.apache.struts.action.DynaActionForm">
<form-property name="action" type="java.lang.String"/>
<form-property name="id" type="java.lang.String"/>
<form-property name="name" type="java.lang.String"/>
</form-bean>
in EditarInstitucionAction I have this...
if(form==null){
DynaActionForm institucionForm = new DynaActionForm();
PropertyUtils.setSimpleProperty(institucionForm, "action", "crear");
PropertyUtils.setSimpleProperty(institucionForm, "codigo", "-1");
request.setAttribute(mapping.getAttribute(),institucionForm);
}
return (mapping.findForward("success"));
then in editarInstitucion.jsp I have....
<logic:equal name="institucionForm" property="action"
scope="request" value="crear">
<title><bean:message key="editarInstitucion.titulo.crear"/></title>
</logic:equal>
<logic:equal name="institucionForm" property="action"
scope="request" value="modificar">
<title><bean:message key="editarInstitucion.titulo.modificar"/></title>
</logic:equal>
I get this Exception
java.lang.NullPointerException
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.java:1548)
at
co.com.proveedores.EditarInstitucionAction.execute(EditarInstitucionAction.java:104)
If I make this changes...
if(form==null){
DynaActionForm institucionForm = new DynaActionForm();
request.setAttribute(mapping.getAttribute(),institucionForm);
}
return (mapping.findForward("success"));
I get this Exception
javax.servlet.ServletException: Exception accessing property action for
bean institucionForm: java.lang.NullPointerException
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:494)
at
org.apache.jsp.editarInstitucion_jsp._jspService(editarInstitucion_jsp.java:93)
What I'm doing wrong? Is there any other way to use DynaFormAction?
Thanks in advance,
--
Germ�n Leonardo Largo Urrea
Medell�n, Colombia
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>