aspose file tools*
The moose likes Struts and the fly likes Form Submission without ActionForm in Struts 1.3. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Form Submission without ActionForm in Struts 1.3." Watch "Form Submission without ActionForm in Struts 1.3." New topic
Author

Form Submission without ActionForm in Struts 1.3.

Sherlyn Glory
Greenhorn

Joined: Aug 18, 2008
Posts: 3
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?


Sherlyn SCJP 1.5(94%) SCWCD5.0(100%)
Tom Rispoli
Ranch Hand

Joined: Aug 29, 2008
Posts: 349
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

Joined: Apr 16, 2008
Posts: 2187
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

Joined: Nov 19, 2002
Posts: 39

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

Joined: Sep 29, 2008
Posts: 12617

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

Joined: Nov 19, 2002
Posts: 39
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

Joined: Sep 29, 2008
Posts: 12617

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Form Submission without ActionForm in Struts 1.3.