Content deleted Content added
Added an intrawiki link to this article for "Composite Pattern". |
|||
(57 intermediate revisions by 37 users not shown) | |||
Line 1:
{{Short description|Programming language and libraries}}
'''Java view technologies and frameworks''' are [[web-based]] [[software libraries]] that provide the [[user interface]], or "[[Model–view–controller|view-layer]]", of [[Java (programming language)|Java]] [[web application]]s. Such [[application framework]]s are used for defining [[web page]]s and handling the [[HTTP]] [[List of HTTP header fields#Requests|requests]] (clicks) generated by those web pages. As a sub-category of [[web
Java view-layer frameworks often claim to support some or all of the [[
==At a glance==
{| class="wikitable
|-
! Action-based frameworks:
| [[Apache Struts]], [[Spring Framework|Spring MVC]]
|-
! Component-based frameworks:
| [[Apache Click]], [[Apache Tapestry]], [[Apache Wicket]], [[
|-
! Web template systems:
| [[Apache Tiles]], SiteMesh, [[
|-
|}
* [[
* In contrast, Struts and the [[Spring Framework|Spring MVC Framework]] are action-oriented frameworks that provide a thinner [[abstraction layer]] over the servlet [[API]].
* Apache Tiles is a templating framework designed to work with Struts.
* [[Facelets]] is a view definition and templating technology designed to work with JSF.
*
* Facelets, Tapestry and Wicket have their own templating approaches based on [[HTML]]/[[XHTML]].
* [[Apache Click]] uses HTML based [[Apache Velocity]] templates and [[
==Servlet API==
{{main |Jakarta Servlet}}
The Servlet API is the foundation of almost all Java Web View technologies.
==
{{main |Jakarta Server Pages}}
* Built on top of the Servlet API, JSP provides for an HTML-centric server programming model.▼
▲* Built on top of the Servlet API, JSP provides
* Java code may be embedded in JSP files and is compiled and executed when a request is received.
==Apache Struts==
{{main |Apache Struts}}
* Struts provides for a [[decoupling]] of the Controller and the View.▼
▲* Struts provides for a [[coupling (computer programming)|decoupling]] of the Controller and the View.
* Requests are received by a Java Class (Controller) which can decide which View to display.
* The actual View can be written in different view technologies, like JSP, free marker template, velocity template etc.
Line 41 ⟶ 47:
==Apache Tapestry==
{{main |Apache Tapestry}}
* A component-based view framework.
* Classes are written as POJOs and byte-code transformed at
* Configured with annotations and naming conventions rather than XML
* Compared to JSPs, enforces a clear separation of [[HTML element|HTML markup]] and Java code.
* HTML templates
* Changed component classes are live-reloaded into running application for faster development.
* Uses the [[Post/Redirect/Get]] navigation pattern for form submission.
Line 51 ⟶ 59:
==Apache Tiles==
{{see also |d:Special:EntityPage/Q28912908|l1=Apache Tiles}}
* This is an HTML templating framework based on the [[Composite pattern]].▼
* It allows for the HTML page to be broken up into multiple [[pagelet]]s, called Templates, Definitions and Composing pages.▼
* At [[run time (program lifecycle phase)|run time]] the pagelets are stitched together to generate the final HTML. Pages are written in JSP.▼
▲* It allows for the HTML page to be broken up into multiple
▲* At [[
* '''Competitor''': SiteMesh
==Apache Wicket==
{{main |Apache Wicket}}
* A component-based view framework.
* Pages directly interact with stateful Java components on the server.
Line 65 ⟶ 77:
* '''Competitor''': Tapestry, JSF
==
{{main |Jakarta Faces}}
* A specification for component-based view frameworks.
* [[Eclipse Mojarra]] and [[Apache MyFaces]] implementations are available
* Typically uses Facelets for XML/XHTML-based templating.
* Classes are written as POJOs, with
* The [[Unified Expression Language]] allows binding component fields and events to POJO bean properties and methods.
* Conversion and validation constraints can be specified in Facelets and are automatically applied, normally resulting in reposting of the same page with error information in case of failure.
Line 77 ⟶ 91:
==SiteMesh==
{{main |SiteMesh}}
* * 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.
Line 84 ⟶ 100:
* '''Competitor''': Tiles
==Spark==
{{main |Spark (software)}}
* Spark a micro web framework built around a simple routing system
* It runs on an embedded [[Jetty (web server)|Jetty]] web server by default, but can be configured to run on other webservers.
*[[List of web service frameworks]]▼
* It supports three different templates engines: [[Apache Velocity|Velocity]], [[FreeMarker]] and [[Mustache (template system)|Mustache]]
* It aims to facilitate rapid development, and does not make use of annotations or proprietary solutions.
==
{{Portal|Computer programming}}
▲* [[List of web service frameworks]]
* [[List of Java frameworks]]
[[Category:Java (programming language)]]
[[Category:Java APIs]]
|