• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts concerns...??!!!

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all,
I am a new struts user…and exploring whether I can construct my web appliction around struts framework instead of using traditional JSP (logic and presentation combined) way of development??
My first issue is :
What is the advantage of using struts taglib to declare Form and other presentaion related tags over std. Html??
Is it somewhere related to the way Form Bean handles request parameter and does front-end validations???
My 2nd issue is :
Can we have multiple actions for the same jsp page in struts depending upon what button the user has pressed??
Then how do we define path and type in action mpping in struts-config and the jsp page itself??
Please throw some light???
Thanks
Lusha
 
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by lusha tak:
What is the advantage of using struts taglib to declare Form and other presentaion related tags over std. Html??


You just write a form bean with the properties as getter/setter methods and struts will initialise the form bean at the beginning of the request, and fill the html with the correct values from the form bean at the end. Much less work than doing it manually.


Is it somewhere related to the way Form Bean handles request parameter and does front-end validations???


Front-end? Do you mean client-side? No - validator module will do that. Or do you mean server-side type validations? Those you write yourself in the form-bean's validate method.


My 2nd issue is :
Can we have multiple actions for the same jsp page in struts depending upon what button the user has pressed??


In struts you generally use a string token which you check in your action perform/execute to decide what to do. This token can be set in many ways. Using submit buttons is just one method. There is a struts solution called DispatchAction.


Then how do we define path and type in action mpping in struts-config and the jsp page itself??


Your path and type would stay the same. Just the token you use changes.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic