• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Form Submission without ActionForm in Struts 1.3.

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 349
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
.....

 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic