Java: View Technologies and Frameworks
From Seo Wiki - Search Engine Optimization and Programming Languages
Jump to navigationJump to search
This article or section has multiple issues. Please help improve the article or discuss these issues on the talk page.
|
A plethora of Java Web Frameworks have mushroomed in the recent years. Some of them are in direct competition, while others are complementary technologies. It is therefore necessary to understand where exactly each technology/framework fits into the J2EE scheme of things. This page lists the "View Technologies". These are the frameworks which are used for defining the web pages and the Server side programs which handle the requests (clicks) generated by the web pages.
At a glance
HTTP Paradigm | Component Paradigm | Templating |
---|---|---|
Struts | Wicket | Tiles |
Tapestry | Sitemesh | |
JSF | Facelets | |
Click |
- Struts is relatively easier to use for beginners because it contains the familiar HTTP paradigm of Request/Response. However, the Component based frameworks are architecturally superior, and usually recommended for creating more complex web applications.
- Wicket, Tapestry and JSF are competing technologies.
- Tiles is a templating framework which is designed to work with Struts.
- Sitemesh can be used with any JSP.
- Facelets is designed to work with JSF.
- Wicket and Tapestry have their own native templating.
- Click uses HTML based velocity templates and plain old Java objects. JSP is optional.
Servlet API
- This is the foundation of almost all Java View technologies.
- It provides the basic framework for writing Java classes, called 'Servlets' that can respond to HTTP Requests, create Cookies and maintain Sessions.
JSP
- Built on top of the Servlet API, JSP provides for a HTML centric Server programming model.
- Java code is embedded in the JSP files and is executed when a request is received.
Struts
- Built on top of the Servlet API, Struts provides for decoupling between the Controller and the View.
- Requests are received by a Java Class (Controller) which can decide which View to display.
- The actual View is written as a JSP page.
- An XML configuration file is used to specify the "Page Navigation", i.e. the flow of the request to the appropriate Controller, and which View to display based on the outcome of the Controller.
- Competitor: Though Struts does not have any direct competitor in its league, Component View Technologies (like Wicket, Tapestry) are generally accepted as superior.
Tiles
- This is a HTML templating framework based on the "Composite" model.
- It allows for the HTML page to be broken up into multiple pagelets, called Templates, Definitions and Composing pages.
- At run time the pagelets are stitched together to generate the final HTML. Pages are written in JSP.
- Competitor: Sitemesh
Sitemesh
- This is a HTML templating framework based on the "Decoration" model.
- It allows for the creation of a 'decoration' template which is then applied to any other HTML to generate a new HTML.
- The newly generated HTML contains elements from the original HTML blended into the template.
- This allows for the original HTML to be very simple and devoid of any formatting or layout specification. The template, in turn, is devoid of any actual information.
- Blending the two allows for a consistent look and feel for all web pages.
- Competitor: Tiles
Wicket
- Provides a 'Component' view technology - meaning the Request-Response Stateless paradigm of HTTP is abstracted away to give rise to an Object Oriented Stateful paradigm.
- Pages now directly interact with Stateful Java Components on the server.
- Components and their State are managed by the Wicket framework, freeing the application developer from having to use HttpSession directly to manage state themselves.
- Further, Wicket provides for a clear separation of HTML markup from code, and there are no XML configuration files to manage.
- Web page components are 'pushed' into the HTML markup from the code.
- Competitor: Tapestry, JSF
Tapestry
- Provides a 'Component' view technology.
- Classes are written as POJOs and Annotations are used to configure them as Tapestry components.
- HTML components can directly refer to the component methods and attributes.
- Competitor: Wicket, JSF
References
- Java Servlet Technology (http://java.sun.com/products/servlet/)
- JavaServer Pages Technology (http://java.sun.com/products/jsp/)
- Apache Struts 2 Documentation (http://struts.apache.org/2.1.6/docs/home.html)
- Apache Struts Tiles (http://struts.apache.org/1.x/struts-tiles/)
- Click Framework Project Documentation (http://incubator.apache.org/click/)
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...
→