Expression is used to insert the value of a java language expression. Expression values are converted into String object and would be put into the implicit out object.

JSP Expression Syntax

<%= scripting-language-expression %>

JSP Expression Sample Program (github)

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
final String who;
who = request.getParameter("who");

<h4>Hello <%= who %>!</h4>

How to run JSP Expression Sample Program


Leave a comment

Your email address will not be published. Required fields are marked *