Getting a Request Parameter Using JSTL in a JSP Page - Java Servlet JSP

Java examples for Servlet JSP:JSTL

Description

Getting a Request Parameter Using JSTL in a JSP Page

<%-- Declare the core library --%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>

<c:choose>
    <c:when test="${empty param.name}">
        Please enter your name.
    </c:when>
    <c:otherwise>
        Hello <b><c:out value="${param.name}" /></b>!
    </c:otherwise>
</c:choose>
http://hostname.com/mywebapp/mypage.jsp?name=YourName+Smith
Hello <b>YourName Smith</b>!

Related Tutorials