aspose file tools*
The moose likes Struts and the fly likes Unable to create a form object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to create a form object" Watch "Unable to create a form object" New topic
Author

Unable to create a form object

Skanda Raman
Ranch Hand

Joined: Mar 21, 2008
Posts: 205

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

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?
Skanda Raman
Ranch Hand

Joined: Mar 21, 2008
Posts: 205

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
Skanda Raman
Ranch Hand

Joined: Mar 21, 2008
Posts: 205

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.
 
wood burning stoves
 
subject: Unable to create a form object