Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

struts concerns...??!!!

 
lusha tak
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • 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
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic