Author
Unable to create a form object
Eshwar Prasad
Ranch Hand
Joined: Mar 21, 2008
Posts: 191
I have developed a simple struts application using struts 1.1.
But while executing, I am not getting form object populated. Hence, the control is not reaching if(form!=null) condition written in my action class.
Please let me know if I am doing any mistake.
Below is the code of my application
Struts-config.xml
LoginAction.java
LoginForm.java
Login.jsp
David Newton
Author
Rancher
Joined: Sep 29, 2008
Posts: 12617
posted Aug 11, 2010 07:15:10
0
What path are you taking through the system (what URLs are you using)? What are you actually trying to do? "form" will never be null inside an execute method like that; Struts will create the form.
Why are you learning such an antiquated version of Struts?
Eshwar Prasad
Ranch Hand
Joined: Mar 21, 2008
Posts: 191
David,
I am placed in a legacy project, which uses struts 1.1 code base. Hence, we are maintaining the project.
Can you please let me know if there are errors in the scripts i pasted.
I am login to the page as http://localhost:8080/sampleapp/Login.do
This is my own sample application & referring to any online materials.
Here i just want to demonstrate if the value is not zero, display the success page
Eshwar Prasad
Ranch Hand
Joined: Mar 21, 2008
Posts: 191
David,
I am placed in a legacy project, which uses struts 1.1 code base. Hence, we are maintaining the project.
Can you please let me know if there are errors in the scripts i pasted.
I am login to the page as http://localhost:8080/sampleapp/Login.do
This is my own sample application & referring to any online materials.
Here i just want to demonstrate if the value is not zero, display the success page
Pawan Komaram
Ranch Hand
Joined: Dec 08, 2009
Posts: 91
The form class name(fully qualified name) is given wrong in your struts config file.
According to your form class package, it should be
That is the reason struts cannot identify your form class to be passed to execute method.
subject: Unable to create a form object