Hello. I am currently developing a Struts application. For some reason,
form variables are not being transmitted upon form submission and at the
same time there is no error or stack trace that I can reference to
diagnose the error. I am not able to access the form variables inside my
action class for which I have provided the code below (i.e. the form
variables always have a value of null). I have also provided the contents
of struts-config.xml below. FYI, I am not using the Struts validator. Any
help would be greatly appreciated. Thanks.
- Asad
package registration;
import javax.servlet.http.*;
import org.apache.struts.action.*;
public class BusinessToolsStepOneAction extends Action {
public ActionForward execute (ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
String businessName = request.getParameter("businessName");
String businessAddress = request.getParameter("businessAddress");
String businessZipCode = request.getParameter("businessZipCode");
String businessPhoneNumber = request.getParameter("businessPhoneNumber");
if ((businessName == null) || (businessAddress == null) ||
(businessZipCode == null) || (businessPhoneNumber == null)) {
return (mapping.findForward("missing-business-data"));
}
else {
return (mapping.findForward("business-tools-step-two"));
}
}
}
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">
<struts-config>
<global-forwards>
<forward name="home" path="/home.jsp" />
</global-forwards>
<action-mappings>
<action path="/businessToolsStepOne"
type="registration.BusinessToolsStepOneAction">
<forward name="missing-business-data" path="/missingBusinessData.jsp"
/>
<forward name="business-tools-step-two" path="/businessToolsStepTwo.jsp"
/>
</action>
</action-mappings>
</struts-config>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]