> -----Original Message----- > From: Campano, Troy [mailto:[EMAIL PROTECTED]] > Sent: Friday, October 04, 2002 7:21 PM > To: [EMAIL PROTECTED] > Subject: Good jsp/java design with good response. > > Hi, > I'm wondering your opinions to this JSP design questions. > > I build web applications that generally talk to a database. > There is usually a form..or interface screen and a processing > page that does all the backend work (connects to database and > stuff like that). > > I want all my "interface screens" to be written JSTL, since > that seems to be a good separation between logic and interface. > I'm not sure how to do the processing pages. I was thinking > writing a bunch of classes and putting then in a JAR and > calling them from 1 JSP page, but that seems that it would > slow response time. Do you think it would?
In general, your goal is to implement an application using a MVC strategy. There are several frameworks that will help you achieve that. One of those is Jakarta Struts. It is composed of two basic pieces, the MVC framework and a set of JSP tag libraries. The MVC framework uses a single opaque (which means you normally don't have to know how it works) servlet that uses a configuration file you write which specifies the "flow" of your application. The configuration file specifies your application "actions". It's best to let your Action code specify business logic, and let the configuration file specify which pages are used for each action. The other basic piece is a set of JSP tag libraries that make it easier to construct a JSP page that just contains "view logic", which only reads properties from Java beans, as opposed to using complex scriplets. There are also several auxiliary pieces of Struts: The Validator framework will facilitate the building of relatively complex reusable client-side validation logic. The Tiles framework allows you to easily separate your "layout" logic from the logic which specifies which components are being displayed. If you have a large number of pages with complex, but similar layouts, this makes it easier to manage that. The Nested tag library is an enhancement that makes it easier to read properties in a deeply nested hierarchy. The Struts-EL library is a derivation of the Struts tag library, but which uses the JSTL expression language engine to evaluate attribute values, instead of "rtexprvalues". Note that some of the more recent enhancements to Struts are only available in version 1.1-beta2 (the Struts-EL library is still only available from the nightly build). I don't consider the "beta" aspect of this to be very risky. This latest version has been quite stable for a long time. The 1.1 release is not waiting for complex features or large bug fixes, just the right time for the committers to do the work (don't quote me on that). You can get information about Jakarta Struts at <http://jakarta.apache.org/struts/index.html>. =========================================================================== To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST". For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST". Some relevant FAQs on JSP/Servlets can be found at: http://archives.java.sun.com/jsp-interest.html http://java.sun.com/products/jsp/faq.html http://www.esperanto.org.nz/jsp/jspfaq.jsp http://www.jguru.com/faq/index.jsp http://www.jspinsider.com