So I have a form in one JSP and one to pass the data to another JSP to check whether is it empty or not. Can I do this?
First.jsp
<form id="search-form" name="search">
<input type="text" name="txtSearch" id="search-field">
<button type="submit" onclick="<c:set var="search" value="${param.txtSearch}" scope="request"/>"><a href="Second.jsp">SEARCH</a></button>
</form>
Second.Jsp
<c:set var="search" value="${requestScope['search']}"/>
<c:choose>
<c:when test="${empty search}">
<h1>Empty</h1>
</c:when>
<c:otherwise>
<h1>${search}</h1>
</c:otherwise>
</c:choose>