You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Sumit S." <su...@virtusa.com> on 2003/11/12 18:54:45 UTC
Null DynaActionForm
Hi,
How do I create a new instance of a DynaActionForm when the form passed to my Action.execute() method is null ?
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
try
{
DynaActionForm userForm = null;
if (null != form)
{
userForm = (DynaActionForm) form;
System.out.println("IT IS NOT NULL");
}
else
{
/*NEED TO CREATE A NEW INSTANCE HERE*/
System.out.println("IT IS NULL");
}
RE: Null DynaActionForm
Posted by Matt Pease <li...@fullscreen.com>.
Probably you aren't properly setting up the dynaActionForm in
your struts-config.xml file.
matt
-----Original Message-----
From: Sumit S. [mailto:sumits@virtusa.com]
Sent: Wednesday, November 12, 2003 12:55 PM
To: struts-user@jakarta.apache.org
Subject: Null DynaActionForm
Hi,
How do I create a new instance of a DynaActionForm when the form passed
to my Action.execute() method is null ?
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception
{
try
{
DynaActionForm userForm = null;
if (null != form)
{
userForm = (DynaActionForm) form;
System.out.println("IT IS NOT NULL");
}
else
{
/*NEED TO CREATE A NEW INSTANCE HERE*/
System.out.println("IT IS NULL");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org