JSP Expression Tag

The code placed within JSP expression tag is written to the output stream of the response. Here there is no need to write out.print() to display output. It is mainly used to print the values of variable or method. The general form is:

<%= statement %>

Example1:
<html>
<body>
    <%= "Welcome to java8s.com" %>
</body>
</html>

Example2:
Demo.jsp
<html>
<body>
    <form action="welcome.jsp">
    <input type="text" name="uname">
    <input type="submit" value="ok">
    </form>
</body>
</html>

welcome1.jsp :
<html>
<body>
    <%= "Welcome "+request.getParameter("uname") %>
</body>
</html>

About the Author



Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.

We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc





 PreviousNext