0 votes
1 view
in Java by (1.1k points)
How are JSP and Servlet related to each other? Is JSP some kind of Servlet? How are JSP and JSF related to each other? Is JSF some kind of prebuild UI based JSP like ASP.NET-MVC?

1 Answer

0 votes
by (13.2k points)

Java Server Pages (JSP)

It is the java technology which helps web developers and designers to develop and easily maintain, dynamic Web pages. This technology separates the user interface from content generation which in turn enables designers to change the overall page layout without altering the underlying content. It also supports expression language which is useful for accessing backend data. For JSP, all the tag attributes are to be declared in the TLD file in order for it to work and the templating goes on outside of core JSP contrary to facelets.

Java Server Faces (JSF)

JavaServer Faces is the Java standard technology for building web interfaces which are component based and event oriented. Like JavaServer Pages, JSF also allows access to server-side data and logic, but unlike java server pages, JSF is an XML document that represents components in a logical tree. Facelets is more suited to JSF than JavaServer Pages.

Servlets

Servlet is basically a Java API, which intercepts requests made by the client, then sends a response. When a Servlet is first called, the servlet container creates an instance of it and keeps it in memory ( till its lifetime).

They are used to handle the request obtained from the web server, which is then processed and a response is produced, after which it is sent to the web server. So they work on the server side and have the capability of handling the complex request from the server. The request data can be accessed by HttpServletRequest.

Related questions

0 votes
1 answer
asked Sep 2 in Java by Anvi (8.7k points)
0 votes
1 answer
0 votes
1 answer
asked Sep 10 in Java by Nigam (3.8k points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...