JSP is an acronym of Java Server Page. Java Server Pages (JSP) is a technology that helps software developers create dynamically generated web pages based on HTML, XML, or other document types. JSP was released in 1999 by Sun Microsystems and it uses the Java programming language.
What is a JSP?
- JSP is a file extension for Java Server Pages file format. A JSP is a HTML page containing a reference to Java servlets, or, java server side applets.
- A Java Server Pages component is a type of Java servlet that is designed to fulfil the role of a user interface for a Java web application. Web developers write JSPs as text files that combine HTML or XHTML code, XML elements, and embedded JSP actions and commands.A JSP page consists of HTML tags and JSP tags.
- The JSP pages are easier to maintain than servlet because we can separate designing and development. It provides some additional features such as Expression Language, Custom Tag etc.
- JSP is a text-based document that contains two types of text:
Static template data: It can be expressed in any text-based format, such as HTML, SVG, WML, and XML.
JSP elements: It constructs dynamic content.
Where it can be used?
- Presentation stuff and servlets are used for control and business logic stuff. They are good for non-HTML content, such as a file download servlet or a chart generating servlet, because it is simpler to deal with that content in servlets which we will discuss later on this tutorial.
- Retrieving information from a database or registering user preferences, accessing JavaBeans components, passing control between pages and sharing information between requests, pages etc.
- Collect input from users through web page forms, present records from a database or another source, and create web pages dynamically.
- Create web application just like Servlet technology. It can be thought of as an extension to servlet because it provides more functionality than servlet such as expression language, jstl etc.