File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlets and Struts

 
John Ryan
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I just wanted to enquire if many people have experience of using the struts framework with their servlets. What are the advantages of this over pure servlet programming?
Thanks
John
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Struts is based on MVC (Model-View-Controller)pattern which reduces the coupling betwen various components.
The Contoller is represented as Servlet(maps the user action as functions on the model),the view as JSP (renders the content of the model)and model as action classes and java beans.struts is based model 2 architecture and increases the maintainability of a web site.
Struts has a learning curve but is useful in a long run.
For more info visit http://apache.org
[ May 21, 2002: Message edited by: Pradeep Manjeshwar ]
 
Stephen Peterson
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked into Struts awhile back for applicability to my JSP application. I use model 2, in the sense that I have a single Servlet controller that forwards reqests to various Java Handlers, which call the model, then flow to a JSP page for presentation.
My JSP pages though have a variable number (0 to 15 or more) of HTML input elements of various types: text areas, text fields, href anchors, and buttons, depending on run-time information read from a database. Each page represents a row of a database table, and allows browsing, update, insert, or detete operations on a row of the database table, sometimes per additional business rules, also read from a database table.
My reading seemed to indicate that this design would not be adaptable to Struts, since an assumption is made (as also seems to be with EJBs) that the number of fields in a JSP page is known at compile-time. Is this the case?
 
Stephen Peterson
Ranch Hand
Posts: 33
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked into Struts awhile back for applicability to my JSP application. I use model 2, in the sense that I have a single Servlet controller that forwards reqests to various Java Handlers, which call the model, then flow to a JSP page for presentation.
My JSP pages though have a variable number (0 to 15 or more) of HTML input elements of various types: text areas, text fields, href anchors, and buttons, depending on run-time information read from a database. Each page represents a row of a database table, and allows browsing, update, insert, or detete operations on a row of the database table, sometimes per additional business rules, also read from a database table.
My reading seemed to indicate that this design would not be adaptable to Struts, since an assumption is made (as also seems to be with EJBs) that the number of fields in a JSP page is known at compile-time. Is this the case?
 
David Yutzy
tumbleweed and gunslinger
Ranch Hand
Posts: 192
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We also looked at struts and there are a lot of assumptions and techniques that have to be made in order to even USE struts. Example, we work with clients who use anything from Websphere, to Weblogic, to NetBeans, to JBuilder, to Textpad for java development.
Most of the commerical design tools also "force" you into their design model and process and thus make it very difficult, albeit not impossible, to use struts in their environments, however, this only increases the process of getting a project to completion rather than taking advantage of the "rapid" nature of struts.
Especially if you "cut you teeth" on java in those environments to begin with...
Bottom line, if you want to use struts, forget the dev. environment and use TextPad to begin with, then once you have it down, put the two together and use your dev. environment...
 
John Ryan
Ranch Hand
Posts: 124
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So if not using the Struts MVC pattern you could possible end up retrieving data and setting up your view (JSP, Html) within the one class. I have used MVC before and found it helps create cleaner code alright.....
 
Nate Johnson
Ranch Hand
Posts: 301
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am on the portal team at Indiana University and we just finished round 1 of our enterprise portal. It is written in java using struts and we have over 100,000 students, faculty and staff + more that 400,000 alums that can use this. So far so good with the scalability and all. Check it our (through the guest access mode) and let me know what you think or if you have any questions.
https://onestart.iu.edu
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic