Java 17 Recipes


MVC (MODEL-VIEW-CONTROLLER)


Download 3.2 Mb.
Pdf ko'rish
bet244/245
Sana02.06.2024
Hajmi3.2 Mb.
#1839910
1   ...   237   238   239   240   241   242   243   244   245
Bog'liq
Java 17 Recipes

MVC (MODEL-VIEW-CONTROLLER)
the most widely used pattern in application development is MvC (Model-view-Controller). this 
pattern was described by Xerox, for the first time, in several publications in the late eighties. 
the most important aspect is the separation into three distinct components.
• Model is related to the application logic and persistence of data manipulation.
• view is related to the presentation, that is, the interface with the end user.
• Controller is related to the processing of requests.
this level of separation is important both for reasons of stability and security of the application. 
in this chapter, the development of Java web applications is based on the following main 
components.
• MysQl is a powerful relational database (rDbMs) for creating and managing 
databases for web applications: in fact, any non-trivial web application is likely 
to need handling data.
• Javaserver pages (Jsp) is a technology that helps you create such dynamically 
generated pages by converting script files into executable Java modules.
• tomcat is a server application that can execute your code and act as a web 
server for your dynamic pages.
13-2. Creating an HTML Page
 Problem
You want to create a simple HTML page.
 Solution
HTML documents are organized as a hierarchy of elements that normally consist of 
content enclosed between a pair of start and end tags.
The following is the schema.
contents
Chapter 13 Java Web appliCations


484
You can nest HTML elements inside each other. In fact, without nesting, no 
HTML page would be possible. The tag can be organized in the following way (with 
indentation).


content 2


For example, the  and  tags delimit the whole HTML document. 
However, some elements are empty, in which case you can usually replace the end 
tag with a slash immediately before the closing bracket of the start tag, as in src="mypict.gif"/>.
You can insert comments in the following way.
Each tag can have attributes with values.

The HTML document presents two sections.
...
...
Bold characters
Underline characters
Italic characters
A newline
A paragraph

Download 3.2 Mb.

Do'stlaringiz bilan baham:
1   ...   237   238   239   240   241   242   243   244   245




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling