23-05-2012, 04:31 PM
Struts Survival Guide
Struts_Survival_Guide.pdf (Size: 4.47 MB / Downloads: 78)
J2EE Platform
As you might be already knowing, J2EE is a platform for executing server
side Java applications. Before J2EE was born, server side Java applications were
written using vendor specific APIs. Each vendor had unique APIs and
architectures. This resulted in a huge learning curve for Java developers and
architects to learn and program with each of these API sets and higher costs for
the companies.
J2EE web application
Any web application that runs in the servlet container is called a J2EE web
application. The servlet container implements the Servlet and JSP specification.
It provides various entry points for handling the request originating from a web
browser. There are three entry points for the browser into the J2EE web
application - Servlet, JSP and Filter. You can create your own Servlets by
extending the javax.servlet.http.HttpServlet class and implementing
the doGet() and doPost() method. You can create JSPs simply by creating atext file containing JSP markup tags.
Markup based Rendering
JSPs are perfect examples of markup based presentation tiers. In markup based
presentation, variety of tags are defined (just like HTML tags). The tag
definitions may be purely for presentation or they can contain business logic.
They are mostly client tier specific. E.g. JSP tags producing HTML content. A
typical JSP is interpreted in the web container and the consequent generation of
HTML. This HTML is then rendered in the web browser. The next few
paragraphs cover the role played by JSPs in comparison to Servlets in J2EE web
Template based Transformation
In Template based transformation, a template engine uses a pre-defined template
to transform a given data model into desired output.
XSLT is a perfect example for template based transformation. XSLT stands
for XML Stylesheet Language Transformation. XSLT is used to transform an
XML document in one format into another XML document in another format.
Since HTML is a type of XML, XSLT can be used for generating HTML from
XML. In a J2EE application, J2EE components can generate XML that
represents the data. Then the XML is transformed into HTML
(presentation/view) by using a stylesheet written using the XML Stylesheet
Language (XSL).
application.