Web engineering in Java V4: Introduction to servlet

80 Просмотры
Издатель
Static web
Static web are ones that are fixed and display the same content for every user, usually written exclusively in HTML.
Dynamic web
Is one that can display different content and provide user interaction by the use of advance programming and database in addition to HTML

So a servlet is a Java file which can take the request from the client on the internet it can respond in the format of HTML page

Tomcat is a web container

A special file that tells us which servlet should be executed on the request of client
Also called web.xml


Servlet class extends HttpServlet

Servlets can do anything that a java class can do. For example, connecting with database, reading/writing data to/from file etc.
Handles requests sent by the user (clients) and generates response dynamically (normally HTML pages).
The dynamically generated content is send back to the user through a webserver (client)

We can use Annotation we can avoid web.xml file
Servlet response can be in HTML format . JSON format, Dynamic page

#Servlet #JavaWebDevelopment
Категория
Язык программирования Java
Комментариев нет.