Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to create a form object

 
Skanda Raman
Ranch Hand
Posts: 205
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 205
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 205
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic