![]() | ||||
| Home | Software | Courses | For Programmers | Contact Us |
What is Struts?If you've developed with ASP, JSP or Servlets you've probably had to maintain web applications that are a tangled mess of HTML, scripting code, data access and business logic. And if you're asked to add internationalization to an already complex web app you might be tempted to give up programming and become a tech analyst instead. The answer to our web woes is separation. This means splitting an application into parts with distinct functions and well-defined protocols for communication between them. This way we can maintain or work on some parts without having to worry about others. Struts is a Java based framework that helps you achieve this separation Zen. Certainly, if you're planning to deploy simple pages - no data access needed, no complex business rules and no internationalization - Struts is probably overkill. If some of these requirements are met then your application would probably benefit from using Struts. Where do I start?Just to be sure we're all on the same page I'll assume you know Java. You should know (at the barest minimum) what servlet technology is about even if you've not used it. Some experience with either JSP, ASP or PHP is also necessary if only to appreciate the problems that Struts solves (or doesn't solve). If you haven't any experience with these I'd recommend investing some time learning the basics of JSP. OverviewOne natural way of splitting an application is with the "Model-View-Controller" paradigm:
In Struts:
Besides these there are 3 static files:
In SummaryTo write a typical Struts application you'll need to:
With all that theorizing I'm sure you're dying to get your hands dirty. In the next section you'll see how to install Struts and after that, you'll learn to create a toy Struts web application. Web Resources
| ||||
| Copyright 2005 Thinksquared, all rights reserved. Java is a trademark of Sun Microsystems. | ||||