• 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
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

why ActionForm and not HttpSession

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am newbie to Struts. I have a doubt on ActionForm in Struts.
What is the exact use of actionForm? If it is used to store user specific data coming from HttpRequest then why can't we use HttpSession?
If it performs simple validations cant we use javacript for the same? And is it compulsary to use ActionForm?

Thanks in Advance.

 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vaidehi Agate-keskar wrote:What is the exact use of actionForm?



it gives the form input datas to the Action and vice versa . it is a bridge between the view and action.default it is in request scope. and mainly you should not put every thing into the session

vaidehi Agate-keskar wrote:If it performs simple validations cant we use javacript for the same?


you should not relay on client side validation

vaidehi Agate-keskar wrote:And is it compulsary to use ActionForm?


No.but preferable
 
vaidehi Agate-keskar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Thanks seetharaman.

you should not put every thing into the session

Can you explain it in a bit detail?

And if it is not complusary to use actionForm but preferable, what else we can write instead of action form?

 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

vaidehi Agate-keskar wrote:
you should not put every thing into the session
Can you explain it in a bit detail?



one session per user .it is representation of an user [commonly contains user specification details] . if you put extra thing into that ,it may hit your web application performance ,if more users.

vaidehi Agate-keskar wrote:
And if it is not complusary to use actionForm but preferable, what else we can write instead of action form?



use <form> instead of <html:form> and validation="false" make it in your <action> tag of your struts-config xml

note: it is about struts 1.2
 
vaidehi Agate-keskar
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot! One more question about Action classes:

why to write execute method in Action's subclass?
 
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
So your application has functionality.
 
On my planet I'm considered quite beautiful. Thanks to the poetry in this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic