Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form Submission without ActionForm in Struts 1.3.

 
Sherlyn Glory
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
I am a novice struts programmer.
Can we submit a form in struts 1.3 without having ActionForm and without specifying form specification in action mapping of struts-config.xml?


I tried to do that it gives the following error.

javax.servlet.jsp.JspException: Form bean not specified on mapping for action: "login.do"

could anybody clear my doubt?
 
Tom Rispoli
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you submit an html form using the URL patter that you set up for your struts servlet (probably to handle everything ending in .do) then the servlet will handle it and I think it will always try to find the action in the config file. But if you use a different URL pattern the servlet won't try to process it.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can we submit a form in struts 1.3 without having ActionForm and without specifying form specification in action mapping of struts-config.xml?


No, this is not possible.

Also, "Struts" is a name and the first letter of names are capitalized. This applies both in titles and English sentences.

This does not apply to the letters "struts" in the filename of the "struts-config.xml" file.
 
Frank Truong
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The word 'optionally' in the api of an ActionForm must mean something I don't understand.

.....
An ActionForm is a JavaBean optionally associated with one or more ActionMappings.
.....

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, you're just assuming the "optional" part works both ways: one can define an action form without associating it to an action mapping. One cannot, however, define an action mapping without a form. See the difference?
 
Frank Truong
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,

Beside optionally associating with an ActionMapping, what are the other scenarios in which ActionForm is used for, in Struts?

Frank
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No practical uses I can think of, but that's not the point--you *can* define forms w/o associating them with an action. Doesn't mean you'd *want* to.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic