The Core tag <c: forEach> that Tag is casually known as the substitute of While, do While in java Statements. Its    also works as Loop instance with the form of scriptlet in Java Server pages.



 

  <C:Choose>  Tag is similar to the Java Switch Statement In that case it allow us to choose desired statement that  has to be selected from substituted conditions. This tag has some more features like it has two more tags with it  Like <c:when> tag if the condition goes terminated to next step and the other one is <c: otherwise> works like default value in java switch case statement..And an attribute is also been used in the tag named “Test” that is used for evaluating Condition.



 

       This tag is Been used for Display the Result of an Expression. That is quite similar with the reference of<%...%>.

 

<c:catch> JSTL Tag used for exception handling.. In this Program we are going to discuss about exception handling using <c:catch> core tag.

 
by Dinesh Thakur Category: JSP Elements

When the bill amount exceeds Rs. 1000 then else part of calc.jsp gets executed and it forwards the request to discount.jsp page .

 
by Dinesh Thakur Category: JSP Elements

Standard syntax

<j sp: forward page= "desturl" />

 
by Dinesh Thakur Category: JSP Elements

Standard syntax

<% @ include file= "desturl" %>

 
by Dinesh Thakur Category: JSP Elements

The intention is to introduce the communication in between the servlet and JSP. The welcome page is designed by the HTML code.



 
by Dinesh Thakur Category: JSP Elements

In the below JSP program the aim is to understand how JSP communicates with the database. The designing is done by HTML.



 
by Dinesh Thakur Category: JSP Elements

When we send any request to the JSP program from the browser window, we pass the request URL in the browser window. In this process to send the data along with the request, the programmer also requires adding the query string to request URL explicitly. But this task is highly of technical. For that a graphical user interface is required which can generate a request which mayor may not hold the data. For this purpose, the programmer can use either HTML form or hyperlink to generate the request with or without data. The example of HTML to JSP communication is given below:

 
by Dinesh Thakur Category: JSP Elements

In this Example we will discuss about how to read text file with the JSP objects. First we create a text file that contains strings in it. In the program we use input and output stream for execute the expression.

 
by Dinesh Thakur Category: JSP Elements

             This Example is use to get the Information about Server’s Information. Like port number, server name.

 
by Dinesh Thakur Category: JSP Elements

In this example we will define that about page counter every time a user visit the page will be counted. In this we made a program where i static click variable initialize and the value declare 0. If any user visit site any tym it will display the visit number. With help of for loop it will increase the visits one by one.

 
by Dinesh Thakur Category: JSP Elements

Jsp expressions known as those kind of expressions that are containing the scripting language values. To Display the expression value we create a HTML tags page that will use to fill the required fields that will be displayed according to need.

 
by Dinesh Thakur Category: JSP Elements

We know servlet program is placed in WEB-INF folder. WEB-INF is a private directory of deployed web application. So any web resource program that is placed in WEB-INF folder or its subfolder (like classes) must be configured in web.xml file to make the underlying container and server recognizing web resource program.



 
by Dinesh Thakur Category: JSP Elements

A JSP program can have two types of objects.

• Explicit objects

• Implicit objects

 
by Dinesh Thakur Category: JSP Elements

JSP comment

Used for commenting JSP tags base code (or JSP code) of JSP program. A JSP page compiler recognizes JSP comments. As JSP comments are visible in source, code of  JSP program and not visible in any other process of JSP program execution so these are called hidden comments. They are written like this:

 
by Dinesh Thakur Category: JSP Elements

A JSP page contains tags. The tags are in the form of scripting tags, directive tags and comments. Tags help programmers to develop Java codeless JSP program. Implicit objects increase the functionality of JSP page. Scripting element also helps in generating dynamic content and displaying dynamic content.

 
by Dinesh Thakur Category: JSP Elements

Life cycle of a program includes the phases starting from creating objects for the class, execution, and at last destruction of objects. For this life cycle, JSP needs some life cycle methods.

 

Page 3 of 5



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.