Posts

2. JSP Scripting elements & Directives

  JSP Scriptlet Tag (Scripting elements) JSP scriptlet tag also known as Scriptlets are nothing but java code enclosed within <% and %> tags.  The main purpose of scriptlet tag is to add java code into a JSP page. In JavaServer Pages (JSP), scripting elements are used to embed Java code directly into the HTML content of a JSP page. Scripting elements allow developers to write dynamic content and execute Java code within the JSP file. There are three types of scripting elements in JSP:  Syntax : <% Executable java code %>   or  <jsp:scriptlet>  java code </jsp:scriptlet> 1. Declarations: <%! Declaration %>    - Declarations are used to declare variables or methods in the JSP page.    - They are enclosed between `<%!` and `%>` tags.      - Declarations are typically used for defining variables that can be accessed throughout the entire JSP page.    - Example:   ...

1. JSP Introduction And Life-Cycle

Image
  What is JavaServer Pages? - Java Server Pages (JSP) is a server-side programming technology that use to create of dynamic web application using java programming Language.  - JSP have access to the entire family of Java APIs, including the JDBC API to access enterprise databases.  - A JSP page consists of HTML tags and JSP tags. - JavaServer Pages (JSP) is a technology for developing web pages that support dynamic content. - This helps developers insert java code in HTML pages by making use of special JSP tags, most of which start with <% and end with %>. Syntax: JSP code is written between <% %> tags. <%= expression %> is used for embedding expressions in HTML. Why to Learn JSP ? - JSP allows embedding Dynamic Elements in HTML Pages itself instead of having separate CGI files. - JSP pages can be used in combination with servlets that handle the business logic, the model supported by Java servlet template engines. - Using JSP, you can collect input from...